Skip to content

Commit

Permalink
infra: add preflight script (#1846)
Browse files Browse the repository at this point in the history
  • Loading branch information
xDivisionByZerox authored Feb 18, 2023
1 parent 2e2db6c commit c8c0ca2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Please run `pnpm run preflight` before opening a Pull Request to ensure that your code fulfills the minimal requirements for our project. -->

<!-- Please first read https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md -->

<!-- Help us by writing a correct PR title following this guide: https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md#committing -->
2 changes: 1 addition & 1 deletion .github/workflows/commentCodeGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = async (
issue_number: context.issue.number,
});

const body = `Uncommitted changes were detected after runnning <code>generate:*</code> commands.\nPlease run <code>pnpm run generate:locales</code>, <code>pnpm run generate:api-docs</code>, and <code>pnpm run test -u</code> to generate/update the related files, and commit them.`;
const body = `Uncommitted changes were detected after runnning <code>generate:*</code> commands.\nPlease run <code>pnpm run preflight</code> to generate/update the related files, and commit them.`;

const botComment = comments.find(
(comment) => comment.user?.type === 'Bot' && comment.body?.includes(body)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If you want to make `Faker` a better, please read the following contribution gui

# Important

- Please make sure that you run `pnpm install`, `pnpm run build` and `pnpm run test` before making a PR to ensure that everything is working from the start.
Please make sure that you run `pnpm run preflight` before making a PR to ensure that everything is working from the start.

## Good to know

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@
"ts-check:scripts": "tsc --project tsconfig.check-scripts.json",
"ts-check:tests": "tsc --project tsconfig.check-tests.json",
"test": "vitest",
"test:update-snapshots": "vitest run -u",
"coverage": "vitest run --coverage",
"cypress": "cypress",
"docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run",
"docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"",
"docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"",
"release": "standard-version",
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build"
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build",
"preflight": "pnpm install && run-s format lint build generate:* test:update-snapshots"
},
"devDependencies": {
"@actions/github": "~5.1.1",
Expand Down

0 comments on commit c8c0ca2

Please sign in to comment.