Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm install
18 changes: 1 addition & 17 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
#!/bin/sh
if npm list prettier | grep -q prettier@ ; then
echo husky - prettier is installed
else
echo husky - prettier is not installed, skipping format check
exit 0
fi

# run prettier on all .ts files that are in the commit
changed=$(git diff --diff-filter=ACM --cached --name-only | grep .ts$ | tr '\n' ' ')

if [ -z "$changed" ]; then
echo husky - No modified files to check
exit 0
fi

npx prettier $changed --check
npm exec lint-staged
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
branch_name="$(git symbolic-ref --short HEAD)"
if [ "$branch_name" = "main" ]; then
echo "Pushing directly to main is not allowed."
exit 1
fi
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,7 @@
"package": "gulp clean && npm run build && vsce package -o ms-toolsai-jupyter-insiders.vsix",
"postdownload-api": "npx vscode-dts main",
"postinstall": "npm run download-api && node ./build/ci/postInstall.js",
"prepare": "husky",
"pretest:integration:nonpython": "cross-env VSC_JUPYTER_CI_TEST_VSC_CHANNEL=insiders node ./out/test/datascience/dsTestSetup.js",
"pretest:integration": "node ./out/test/datascience/dsTestSetup.js",
"pretest:performance:execution": "cross-env VSC_JUPYTER_CI_TEST_GREP=@executionPerformance node ./out/test/datascience/dsTestSetup.js",
Expand Down Expand Up @@ -2258,12 +2259,13 @@
"gulp": "^5.0.0",
"gulp-filter": "^7.0.0",
"gulp-rename": "^2.0.0",
"husky": "^8.0.3",
"husky": "9.1.7",
"json2csv": "^5.0.7",
"jsonschema": "^1.4.1",
"keyv": "^4.1.0",
"less": "^4.1.3",
"less-plugin-inline-urls": "^1.2.0",
"lint-staged": "16.2.3",
"lolex": "^6.0.0",
"lru-cache": "^10.0.0",
"mocha": "^11.0.1",
Expand All @@ -2290,6 +2292,12 @@
"utf-8-validate": "^5.0.8",
"util": "^0.12.4"
},
"lint-staged": {
"src/**/*.{ts,tsx}": [
"eslint --cache --fix",
"prettier --write"
]
},
"optionalDependencies": {
"fsevents": "^2.3.2"
},
Expand Down
Loading