Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: move pre-commit checks to CI #893

Merged
merged 18 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ on:
pull_request:

jobs:
LintRepo:
name: Lint Repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- run: |
yarn install
Copy link
Member Author

@manzt manzt May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ideally this action can run very quickly, and fail early (to prevent other jobs from running).

Maybe we could use npx here (rather than yarn installing everything for the repo).

yarn pre-commit
- name: Assert no unstaged changes
run: git diff --exit-code

Build:
name: Build Editor
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"schema-template": "ts-json-schema-generator -p src/index.ts -f tsconfig.json -t TemplateTrackDef --no-type-check --no-ref-encode > schema/template.schema.json",
"schema-versioning": "mkdir -p schema/history/$npm_package_version && cp schema/gosling.schema.json schema/history/$npm_package_version/gosling$npm_package_version.schema.json && cp src/core/gosling.schema.ts schema/history/$npm_package_version/gosling$npm_package_version.schema.ts",
"predeploy": "yarn build-editor; echo \"gosling.js.org\" >> build/CNAME",
"deploy": "gh-pages -d build"
"deploy": "gh-pages -d build",
"pre-commit": "run-p changelog schema schema-higlass schema-theme schema-template format"
},
"peerDependencies": {
"pixi.js": "^6.3.0",
Expand Down Expand Up @@ -155,7 +156,6 @@
},
"husky": {
"hooks": {
"pre-commit": "run-p changelog schema schema-higlass schema-theme schema-template format && git add .",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
Copy link
Member Author

@manzt manzt May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, since our "git flow" is squash & merge PRs, idk if it makes sense to lint every commit for conventional commits.

Instead, something like a GitHub action to lint the PR title would probably make more sense

Not sure if either of you have thoughts on this: @etowahadams @sehilyi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to use the semantic-pull-request you shared and remove the commitlint we use for every commit.

We were using another semantic PR which is deprecated and does not work anymore. We were using commitlit to handle a case where there is only one commit in a PR because in this case GitHub used the commit message and ignored the PR title. But, using PR title by default is now supported, so I don't think we need commitlint anymore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! No need to have every conventional commit name be linted.

}
}
Expand Down