Skip to content

Commit

Permalink
Do some just+pre-commit tweaking
Browse files Browse the repository at this point in the history
* pre-commit: move the linting check ahead of the compiling one, as a
  typescript lint can change the compilaed javascript, so you can end up
  in a situation where the pre-commit check fails twice in a row
* just: add linting and make the default to run all
  • Loading branch information
redsun82 authored and Paolo Tranquilli committed Feb 27, 2025
1 parent 97aac9b commit 9663263
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: local
hooks:
- id: lint-ts
name: Lint typescript code
files: \.ts$
language: system
entry: npm run lint -- --fix
- id: compile-ts
name: Compile typescript
files: \.[tj]s$
language: system
entry: npm run build
pass_filenames: false
- id: lint-ts
name: Lint typescript code
files: \.ts$
language: system
entry: npm run lint -- --fix
- id: pr-checks-sync
name: Synchronize PR check workflows
files: ^.github/workflows/__.*\.yml$|^pr-checks
Expand Down
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Perform all working copy cleanup operations
all: lint sync

# Lint source typescript
lint:
npm run lint -- --fix

# Sync generated files (javascript and PR checks)
sync: build update-pr-checks

Expand Down

0 comments on commit 9663263

Please sign in to comment.