Skip to content

Commit a7eee0f

Browse files
committed
updating pre-commit
1 parent abbf020 commit a7eee0f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.husky/pre-commit

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
# Activate venv if needed
2+
source venv/bin/activate # adjust if using .venv or poetry
13

24
echo "Linting NodeJS code with eslint..."
3-
eslint . --ext .js --ext .js.dist
5+
npx lint-staged
6+
7+
# eslint . --ext .js --ext .js.dist
48

59
echo "Linting python code with Flake8..."
6-
./venv/bin/flake8 ./misc
10+
flake8 ./misc
711

812
echo "Linting python code with PyLint..."
9-
./venv/bin/pylint ./misc
13+
pylint ./misc

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"lint-fix": "eslint . --ext .js --ext .js.dist --fix",
2020
"prepare": "husky"
2121
},
22+
"lint-staged": {
23+
"*.{js,js.dist}": "eslint --fix",
24+
"*.{py,py.dist}": [ "flake8" ]
25+
},
2226
"author": "Webb Pinner",
2327
"homepage": "https://github.com/oceandatatools/sealog-server",
2428
"private": false,

0 commit comments

Comments
 (0)