Skip to content

Commit

Permalink
194 make sure local dev cycle and cicd are aligned (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensWe authored Oct 9, 2024
2 parents d5f6f87 + b4199ad commit 336044b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,9 @@ jobs:
poetry install
npm install
- name: run ruff
run: poetry run ruff check --output-format=github

- name: Run format
run: poetry run ruff format --check

- name: Run pyright
- name: Run pyright # There is no official pyright pre-commit hook
run: poetry run pyright

- name: Run eslint
run: npm run lint

- name: Run prettier
run: npm run prettier:check

security:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
4 changes: 4 additions & 0 deletions .husky/pre-commit-prettier
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run prettier
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ repos:
rev: v0.6.9
hooks:
- id: ruff
args: [--config, pyproject.toml]
- id: ruff-format
args: [--config, pyproject.toml]
- repo: local
hooks:
- id: check-modified-migrations
Expand All @@ -37,7 +39,22 @@ repos:
language: python
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: husky-run-pre-commit-lint
name: husky-lint
language: system
entry: .husky/pre-commit-lint
pass_filenames: false
always_run: true
- id: husky-run-pre-commit-prettier
name: husky-prettier
language: system
entry: .husky/pre-commit-prettier
pass_filenames: false
always_run: true
ci:
autofix_prs: false
autofix_commit_msg: "Auto fix pre-commit.com hooks"
autoupdate_commit_msg: "Update .pre-commit-config.yaml"
skip: [husky-run-pre-commit-lint, husky-run-pre-commit-prettier]
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"prettier": "prettier . --write",
"prettier:check": "prettier . --check",
"lint": "eslint amt/site/static/ts/",
"prepare": "husky"
"prepare": "husky && husky install"
},
"author": "",
"license": "EUPL-1.2",
Expand All @@ -33,8 +33,8 @@
"lint-staged": "^15.2.10",
"mini-css-extract-plugin": "^2.9.1",
"prettier": "3.3.3",
"sass": "^1.79.4",
"replace-in-file-webpack-plugin": "^1.0.6",
"sass": "^1.79.4",
"sass-loader": "^16.0.2",
"style-loader": "^4.0.0",
"stylelint": "^16.9.0",
Expand Down

0 comments on commit 336044b

Please sign in to comment.