Skip to content

Commit

Permalink
refactor: Replace husky & lint-staged by lefthook
Browse files Browse the repository at this point in the history
  • Loading branch information
alimtunc committed Aug 28, 2023
1 parent 03deffc commit 5dc38c6
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 218 deletions.
5 changes: 0 additions & 5 deletions .husky/pre-commit

This file was deleted.

16 changes: 16 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pre-commit:
parallel: true
commands:
eslint-prettier:
glob: "*.{js,ts,jsx,tsx}"
run: pnpm eslint --fix {staged_files} && pnpm prettier --write {staged_files}
tsc:
glob: "*.{js,ts,jsx,tsx}"
run: tsc --skipLibCheck --noEmit
black-isort:
glob: "*.{py}"
run: black {staged_files} && isort --profile=black {staged_files}
mypy:
glob: "*.{py}"
root: "src/"
run: poetry run mypy {staged_files}
6 changes: 0 additions & 6 deletions lint-staged.config.js

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"cypress": "^12.9.0",
"dotenv": "^16.0.3",
"eslint": "^8.40.0",
"husky": "^8.0.0",
"kill-port": "^2.0.1",
"lint-staged": "^13.2.3",
"lefthook": "^1.4.9",
"prettier": "^2.8.8",
"shell-exec": "^1.1.2",
"ts-node": "^10.9.1",
Expand All @@ -16,7 +15,6 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "pnpm exec ts-node ./cypress/support/e2e.ts && (cd src/chainlit/frontend && pnpm run test)",
"prepare": "husky install",
"lintUi": "cd src/chainlit/frontend && pnpm run lint",
"formatUi": "cd src/chainlit/frontend && pnpm run format",
"lintPython": "cd src/ && poetry run mypy chainlit/",
Expand Down
Loading

0 comments on commit 5dc38c6

Please sign in to comment.