cleanup precommit hooks (#3616)
Co-authored-by: Suchintan <suchintan@users.noreply.github.com>
This commit is contained in:
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -64,9 +64,18 @@ jobs:
|
||||
if: steps.cache-venv.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
uv sync --group dev
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: npm
|
||||
cache-dependency-path: skyvern-frontend/package-lock.json
|
||||
- name: Install frontend dependencies
|
||||
working-directory: skyvern-frontend
|
||||
run: npm ci
|
||||
# Finally, run pre-commit.
|
||||
- name: Run all pre-commit hooks
|
||||
uses: pre-commit/action@v3.0.0
|
||||
run: uv run pre-commit run --all-files
|
||||
env:
|
||||
ENABLE_OPENAI: "true"
|
||||
OPENAI_API_KEY: "sk-dummy"
|
||||
|
||||
@@ -17,7 +17,7 @@ repos:
|
||||
hooks:
|
||||
- id: check-python-version
|
||||
name: Check Python Version (3.11-3.13)
|
||||
entry: python -c "import sys; assert (3,11) <= sys.version_info[:2] <= (3,13), f'Python {sys.version_info[:2]} not supported. Use Python 3.11-3.13'"
|
||||
entry: uv run python -c "import sys; assert (3,11) <= sys.version_info[:2] <= (3,13), f'Python {sys.version_info[:2]} not supported. Use Python 3.11-3.13'"
|
||||
language: system
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
@@ -105,6 +105,12 @@ repos:
|
||||
types: [javascript]
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: frontend-precommit
|
||||
name: Frontend Precommit (lint-staged)
|
||||
entry: bash -c 'cd skyvern-frontend && npm run precommit'
|
||||
language: system
|
||||
files: ^skyvern-frontend/src/
|
||||
pass_filenames: false
|
||||
- id: vitest-type-check
|
||||
name: vitest
|
||||
entry: bash -c 'cd skyvern-frontend && ([ -d node_modules ] || npm ci) && npm run test'
|
||||
|
||||
@@ -172,16 +172,21 @@ Updating, improving and correcting the documentation
|
||||
## Styleguides
|
||||
|
||||
### Pre Commit Hooks
|
||||
Make sure to run the pre-commit hooks before committing your code.
|
||||
This will help you to automatically format your code and catch cicd failures early.
|
||||
Make sure to install and run the pre-commit hooks before committing your code.
|
||||
This will help you to automatically format your code and catch CI/CD failures early.
|
||||
```bash
|
||||
# Make sure `pre-commit` is installed
|
||||
pip install pre-commit
|
||||
|
||||
# Run pre-commit hooks on files in your commit
|
||||
# Install the git hook scripts (one-time setup)
|
||||
pre-commit install
|
||||
|
||||
# (Optional) Run pre-commit hooks manually on all files
|
||||
pre-commit run --all-files
|
||||
```
|
||||
|
||||
Once installed, the hooks will run automatically on `git commit`.
|
||||
|
||||
### Commit Messages
|
||||
<!-- TODO
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
cd skyvern-frontend
|
||||
|
||||
npm run precommit
|
||||
16
skyvern-frontend/package-lock.json
generated
16
skyvern-frontend/package-lock.json
generated
@@ -78,7 +78,6 @@
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.5",
|
||||
"husky": "^9.0.11",
|
||||
"lint-staged": "^15.5.2",
|
||||
"postcss": "^8.4.37",
|
||||
"prettier": "^3.2.5",
|
||||
@@ -6328,21 +6327,6 @@
|
||||
"node": ">=16.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/husky": {
|
||||
"version": "9.0.11",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz",
|
||||
"integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"husky": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/typicode"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"format": "prettier --write .",
|
||||
"preview": "vite preview",
|
||||
"prepare": "cd .. && husky skyvern-frontend/.husky",
|
||||
"prepare": "cd .. && command -v pre-commit >/dev/null 2>&1 && pre-commit install || echo 'pre-commit not installed, skipping hook setup'",
|
||||
"precommit": "lint-staged",
|
||||
"run-artifact-server": "node artifactServer.js",
|
||||
"serve": "npm run build && node localServer.js",
|
||||
@@ -87,7 +87,6 @@
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.5",
|
||||
"husky": "^9.0.11",
|
||||
"lint-staged": "^15.5.2",
|
||||
"postcss": "^8.4.37",
|
||||
"prettier": "^3.2.5",
|
||||
|
||||
Reference in New Issue
Block a user