Skip to content
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 Nov 10, 2025
809adc2
Use safer temporary file path for sorting
Subham-KRLX Nov 10, 2025
78e5aa7
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX Nov 10, 2025
af64007
Fix typo: misc.narcisissm -> misc.narcissism
Subham-KRLX Nov 10, 2025
bf8242f
Remove proselint-config.json - only add sorting hook
Subham-KRLX Nov 10, 2025
53f98ab
Add sorted proselint-config.json
Subham-KRLX Nov 10, 2025
d72069b
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX Nov 10, 2025
04c4f1b
Use --indent 2 to maintain 2-space indentation
Subham-KRLX Nov 10, 2025
19319e0
Use --tab for jq to maintain tab indentation
Subham-KRLX Nov 11, 2025
9266de7
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX Nov 11, 2025
c61e60b
Use --tab for jq to maintain tab indentation
Subham-KRLX Nov 11, 2025
491b86f
Make sort hook manual and add jq to Docker
Subham-KRLX Nov 12, 2025
1cd425e
Merge branch 'main' into add-precommit-hook-sort-proselint
Subham-KRLX Nov 15, 2025
8d6c716
Fix CI failures
Subham-KRLX Nov 15, 2025
4963f1e
fix: address PR feedback
Subham-KRLX Nov 29, 2025
6187e32
fix: disable typography.punctuation.exclamation in proselint config
Subham-KRLX Nov 29, 2025
216006f
fix: update dependencies to resolve npm audit vulnerabilities
Subham-KRLX Nov 29, 2025
afe5a07
fix: convert single quotes to double quotes in test file
Subham-KRLX Nov 29, 2025
9d15e3d
ci: install jq in pre-commit workflow
Subham-KRLX Nov 29, 2025
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
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ repos:
stages: [manual]
- repo: local
hooks:
- id: sort-proselint-config
name: Sort proselint config
entry: bash -c 'f=.github/linters/proselint-config.json; jq -S --tab . "$f" > "$f.tmp" && mv "$f.tmp" "$f"'
language: system
files: ^\.github/linters/proselint-config\.json$
pass_filenames: false
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The current implementation with a hardcoded file path in the entry script works, but it's not idiomatic for pre-commit hooks and could be less maintainable. A better approach is to let pre-commit pass the filename to the script. This avoids duplicating the file path and makes the hook more reusable.

By removing pass_filenames: false, pre-commit will pass the matched filename as an argument ($1) to the entry script. 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.

        entry: bash -c 'jq -S --tab . "$1" > "$1.tmp" && mv "$1.tmp" "$1"' --
        language: system
        files: ^\.github/linters/proselint-config\.json$

Copy link
Member

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

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 have added hooks statement in .prettier-commit-config.yaml but yet it failes
Screenshot 2025-11-11 at 4 45 12 PM

Copy link
Contributor Author

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",
}

- id: npm-ci
name: Install Node dependencies
entry: npm ci
Expand Down
Loading