patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

chore(pre-commit): updated pre-commit hook to force commit msg formating

Open nicolethoen opened this issue 3 years ago • 1 comments

This adds the same sort of linting message that makes sure commit messages are formatted correctly that is currently used in Core.

Also bumps to the latest versions of prettier and commitlint dependencies (a major bump).

Also cleaned up the README's packages table formatting

I've attached some screenshots of potential output Screen Shot 2022-09-19 at 4 06 57 PM Screen Shot 2022-09-19 at 4 07 42 PM

nicolethoen avatar Sep 19 '22 20:09 nicolethoen

Preview: https://patternfly-react-pr-8012.surge.sh

A11y report: https://patternfly-react-pr-8012-a11y.surge.sh

patternfly-build avatar Sep 19 '22 20:09 patternfly-build

I'm probably doing something wrong, but it doesn't seem to be doing anything for me. I branched from this PR branch and was able to commit without a valid semantic release versioning message

Packages up to date

cmichael-mac:patternfly-react cmichael$ yarn install
yarn install v1.22.19
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
success Already up-to-date.
$ ts-patch install -s
✨  Done in 0.94s.

hook file is there

cmichael-mac:patternfly-react cmichael$ cat .husky/commit-msg 
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
npx --no -- commitlint --edit

I'm branched from your branch, along with my commit message. Your last 2 commits don't follow the format, either.

cmichael-mac:patternfly-react cmichael$ git log -6 --oneline
a4ef50720 (HEAD -> foo) asdf
cc137eef7 (nicolethoen/turn_on_commit_msg_linter, turn_on_commit_msg_linter) chore: avoid paren around single param in arrow function
40cceeb17 chore: bump versions of prettierand commitlint
baf595f8c chore(pre-commit): add yarn.lock
84e7e3780 chore(pre-commit): updated pre-commit hook to force commit msg formatting
9c5cb016c chore(release): releasing packages [ci skip]

mcoker avatar Sep 26 '22 20:09 mcoker

hm... I think according to the rule, the component name part in parentheses is optional, but I'll double check that. Weird that you're not seeing the linter run... I'll circle back to this. Thanks for taking a look!

nicolethoen avatar Sep 27 '22 12:09 nicolethoen

@mcoker when you were trying to commit before, were you using a tool to help you? in vscode or something like that? I've rebased - maybe see if it works now?

nicolethoen avatar Oct 04 '22 13:10 nicolethoen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Dec 03 '22 20:12 stale[bot]