Skip to content

Commit

Permalink
chore: Add cspell check hook for lefthook (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer authored Nov 4, 2024
1 parent f1082d5 commit e1a0f15
Show file tree
Hide file tree
Showing 6 changed files with 830 additions and 6 deletions.
22 changes: 22 additions & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# REF:
# https://cspell.org/configuration/
# Usage:
# npx cspell --no-progress .

words:
- msvc
- rsort
- ECODE
- endfor
- dotenv
- nushell
- hustcer
- rsbuild
- justfile
- lefthook
- linewise
- dataframe
ignorePaths:
- dist
- pnpm-lock.yaml

11 changes: 8 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md

min_version: 1.5.5
min_version: 1.7.12
skip_output:
- meta # Skips lefthook version printing
- skips # Skips "skip" printing (i.e. no files matched)
- summary # Skips summary block (successful and failed steps) printing
- success # Skips successful steps printing
- failure # Skips failed steps printing
# - execution # I want to skip all execution printing
- execution_info # Skips printing `EXECUTE > ...` logging
# - execution_out # I don't want to Skip printing successfully executed commands' output
pre-push:
scripts:
'sync.sh':
Expand All @@ -21,6 +19,13 @@ pre-push:
pre-commit:
parallel: true
commands:
spell-check:
skip:
- merge
- rebase
stage_fixed: true
glob: "*.*"
run: pnpm cspell --no-progress {staged_files}
eslint:
skip:
- merge
Expand Down
4 changes: 2 additions & 2 deletions nu/release.nu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# TODO:
# [√] Make sure the release tag does not exist;
# [√] Make sure there are no uncommit changes;
# [√] Make sure there are no uncommitted changes;
# [√] Update change log if required;
# [√] Create a release tag and push it to the remote repo;
# Usage:
Expand All @@ -25,7 +25,7 @@ export def make-release [
let majorTag = $releaseVer | split row '.' | first
let statusCheck = (git status --porcelain)
if not ($statusCheck | is-empty) {
print $'You have uncommit changes, please commit them and try `release` again!(char nl)'
print $'You have uncommitted changes, please commit them and try `release` again!(char nl)'
exit 5
}
if ($update_log) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@types/semver": "^7.5.8",
"@types/shelljs": "^0.8.15",
"@vercel/ncc": "^0.38.2",
"cspell": "^8.15.7",
"lefthook": "^1.8.1",
"semver": "^7.6.3",
"typescript": "^5.6.3"
Expand Down
Loading

0 comments on commit e1a0f15

Please sign in to comment.