Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx commitlint --edit ${1}
6 changes: 6 additions & 0 deletions .husky/install.mjs
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());
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx pretty-quick --staged
20 changes: 20 additions & 0 deletions commitlint.config.mjs
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move file to configs folder as done here:
https://github.com/MapColonies/shared-workflows/pull/28/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not finished 😢

Copy link
Contributor

@shimoncohen shimoncohen Dec 17, 2024

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.

Copy link
Contributor Author

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

Copy link
Contributor

@shimoncohen shimoncohen Dec 17, 2024

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.lock to this repo, it doesn't really belong here IMO.

Copy link
Contributor Author

@netanelC netanelC Dec 17, 2024

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

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",
],
],
"header-min-length": [2, "always", 10],
},
};
Loading