-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add commitlint #29
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
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
90986b8
feat: add commitlint workflow
netanelC 9c24146
bla
netanelC c0388f3
chore: check
netanelC ccfd66b
feat: add the configFile
netanelC d1135f3
chore: bla
netanelC d337df6
chore: bla
netanelC 7b727b8
chore: bla
netanelC c76426d
chore: bla
netanelC 51643be
chore: bla
netanelC f50fc43
chore: nb
netanelC 1068b10
fix: finish commit
netanelC 238b1dd
lint(repo): remove space
netanelC 3431de7
style(repo): format commitlint file
netanelC 4d0cfba
refactor: trigger on pull_request
netanelC 9a4e4fb
chore: bla
netanelC b5b3100
chore: bla
netanelC a5434cb
refactor: add husky
netanelC c00bd14
chore: fix
netanelC 1a47ef8
chore: scope empty
netanelC bb464b7
feat: add cache
netanelC 1c50aa0
fix: remove pr-title for separated PRs
netanelC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx commitlint --edit ${1} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Skip Husky install in production and CI | ||
| if (process.env.NODE_ENV === "production" || process.env.CI === "true") { | ||
| process.exit(0); | ||
| } | ||
| const husky = (await import("husky")).default; | ||
| console.log(husky()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npx pretty-quick --staged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| export default { | ||
| extends: ["@commitlint/config-conventional"], | ||
| rules: { | ||
| "scope-empty": [1, "never"], | ||
| "scope-enum": [ | ||
| 2, | ||
| "always", | ||
| [ | ||
| "repo", | ||
| "commitlint", | ||
| "pull-request", | ||
| "npm-publish", | ||
| "push-docker", | ||
| "push-helm", | ||
| "update-artifacts", | ||
shimoncohen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ], | ||
| ], | ||
| "header-min-length": [2, "always", 10], | ||
| }, | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move file to
configsfolder as done here:https://github.com/MapColonies/shared-workflows/pull/28/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not finished 😢
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the early review 😋 I will wait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit config should sit on the repo itself like this
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you removed the workflow on this commit - a5434cb.
This totally changes the PR meaning from adding the workflow to simply adding
commitlint.Why not just add the workflows and enforce them for every PR here? Because I don't want us to add files like
package.lockto this repo, it doesn't really belong here IMO.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too, but it is meaningless to enforce them in a workflow. That way, the commits are already pushed and the checks will just fail..
I want to prevent the wrong commit message from the beginning. Can you think of an alternative besides husky?
And about the pr-title workflow, it is not belong here so I opened a new PR #30