Skip to content

Commit

Permalink
Attempt to make biome format the file prior to running check-translat…
Browse files Browse the repository at this point in the history
…ion-jsons.ts
  • Loading branch information
ElementUser committed Aug 25, 2024
1 parent be3592d commit b8dc374
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ jobs:
run: bun run typecheck
- name: Unit tests
run: bun run test:unit:all
- name: Format markdown with Biome
run: npx biome format translation-progress.md
- name: Check translations jsons
run: bun run check-translation-jsons:no-write
25 changes: 1 addition & 24 deletions scripts/check-translation-jsons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

const biome = require("@biomejs/biome");

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

Expand Down Expand Up @@ -132,29 +130,8 @@ const markdown = createTranslationProgessMarkdown({
"translation-progress.md",
);

// translation-progress is formatted via the CI/CD pipeline prior to running this script
fs.writeFileSync(translationProgressPath, markdown);

try {
const content = fs.readFileSync(translationProgressPath, "utf8");

// Temporary workaround for typing
const format = (options: {
code: string;
filePath: string;
}): Promise<string> => biome.format(options);

const formattedContent = await format({
code: content,
filePath: translationProgressPath,
});

// Write the formatted content back to the file
fs.writeFileSync(translationProgressPath, formattedContent);

console.info("Markdown formatted successfully using Biome.");
} catch (error) {
console.error("Failed to format markdown using Biome.", error);
}
})();

function validateNoExtraKeysInOther({
Expand Down

0 comments on commit b8dc374

Please sign in to comment.