-
-
Notifications
You must be signed in to change notification settings - Fork 72
Add pre-commit hook to sort proselint config #892
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
Open
Subham-KRLX
wants to merge
19
commits into
brisbanesocialchess:main
Choose a base branch
from
Subham-KRLX:add-precommit-hook-sort-proselint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cd7f515
Add pre-commit hook to sort proselint config
Subham-KRLX 809adc2
Use safer temporary file path for sorting
Subham-KRLX 78e5aa7
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX af64007
Fix typo: misc.narcisissm -> misc.narcissism
Subham-KRLX bf8242f
Remove proselint-config.json - only add sorting hook
Subham-KRLX 53f98ab
Add sorted proselint-config.json
Subham-KRLX d72069b
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX 04c4f1b
Use --indent 2 to maintain 2-space indentation
Subham-KRLX 19319e0
Use --tab for jq to maintain tab indentation
Subham-KRLX 9266de7
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX c61e60b
Use --tab for jq to maintain tab indentation
Subham-KRLX 491b86f
Make sort hook manual and add jq to Docker
Subham-KRLX 1cd425e
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX 8d6c716
Fix CI failures
Subham-KRLX 4963f1e
fix: address PR feedback
Subham-KRLX 6187e32
fix: disable typography.punctuation.exclamation in proselint config
Subham-KRLX 216006f
fix: update dependencies to resolve npm audit vulnerabilities
Subham-KRLX afe5a07
fix: convert single quotes to double quotes in test file
Subham-KRLX 9d15e3d
ci: install jq in pre-commit workflow
Subham-KRLX 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
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.
The current implementation with a hardcoded file path in the
entryscript works, but it's not idiomatic forpre-commithooks and could be less maintainable. A better approach is to letpre-commitpass the filename to the script. This avoids duplicating the file path and makes the hook more reusable.By removing
pass_filenames: false,pre-commitwill pass the matched filename as an argument ($1) to theentryscript. This change makes the hook's configuration cleaner and easier to maintain if the file is ever renamed.Additionally, since this hook has a system dependency on
jq, it would be helpful to add a note about this requirement in the repository's contribution guidelines (e.g.,CONTRIBUTING.md) for other contributors.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 make this a manual hook since bash generally does not run on Windows
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 have added hooks statement in

.prettier-commit-config.yamlbut yet it failesThere 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.
"scripts": {
"format": "prettier --write "/*.{css,js,json,md,yaml,yml}"",
"check": "prettier --check "/*.{css,js,json,md,yaml,yml}"", "lint": "eslint --config .github/linters/eslint.config.mjs .",
"lint:fix": "eslint --config .github/linters/eslint.config.mjs . --fix",
}