cleanup precommit hooks (#3616)

Co-authored-by: Suchintan <suchintan@users.noreply.github.com>
This commit is contained in:
greg niemeyer
2025-10-09 18:20:02 -07:00
committed by GitHub
parent 451d5787cd
commit 7cd92f6972
6 changed files with 26 additions and 26 deletions

View File

@@ -64,9 +64,18 @@ jobs:
if: steps.cache-venv.outputs.cache-hit == 'true' if: steps.cache-venv.outputs.cache-hit == 'true'
run: | run: |
uv sync --group dev 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. # Finally, run pre-commit.
- name: Run all pre-commit hooks - name: Run all pre-commit hooks
uses: pre-commit/action@v3.0.0 run: uv run pre-commit run --all-files
env: env:
ENABLE_OPENAI: "true" ENABLE_OPENAI: "true"
OPENAI_API_KEY: "sk-dummy" OPENAI_API_KEY: "sk-dummy"

View File

@@ -17,7 +17,7 @@ repos:
hooks: hooks:
- id: check-python-version - id: check-python-version
name: Check Python Version (3.11-3.13) 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 language: system
pass_filenames: false pass_filenames: false
always_run: true always_run: true
@@ -105,6 +105,12 @@ repos:
types: [javascript] types: [javascript]
- repo: local - repo: local
hooks: 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 - id: vitest-type-check
name: vitest name: vitest
entry: bash -c 'cd skyvern-frontend && ([ -d node_modules ] || npm ci) && npm run test' entry: bash -c 'cd skyvern-frontend && ([ -d node_modules ] || npm ci) && npm run test'

View File

@@ -172,16 +172,21 @@ Updating, improving and correcting the documentation
## Styleguides ## Styleguides
### Pre Commit Hooks ### Pre Commit Hooks
Make sure to run the pre-commit hooks before committing your code. 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 cicd failures early. This will help you to automatically format your code and catch CI/CD failures early.
```bash ```bash
# Make sure `pre-commit` is installed # Make sure `pre-commit` is installed
pip install pre-commit 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 pre-commit run --all-files
``` ```
Once installed, the hooks will run automatically on `git commit`.
### Commit Messages ### Commit Messages
<!-- TODO <!-- TODO

View File

@@ -1,3 +0,0 @@
cd skyvern-frontend
npm run precommit

View File

@@ -78,7 +78,6 @@
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-react-refresh": "^0.4.5",
"husky": "^9.0.11",
"lint-staged": "^15.5.2", "lint-staged": "^15.5.2",
"postcss": "^8.4.37", "postcss": "^8.4.37",
"prettier": "^3.2.5", "prettier": "^3.2.5",
@@ -6328,21 +6327,6 @@
"node": ">=16.17.0" "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": { "node_modules/iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",

View File

@@ -9,7 +9,7 @@
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"format": "prettier --write .", "format": "prettier --write .",
"preview": "vite preview", "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", "precommit": "lint-staged",
"run-artifact-server": "node artifactServer.js", "run-artifact-server": "node artifactServer.js",
"serve": "npm run build && node localServer.js", "serve": "npm run build && node localServer.js",
@@ -87,7 +87,6 @@
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-react-refresh": "^0.4.5",
"husky": "^9.0.11",
"lint-staged": "^15.5.2", "lint-staged": "^15.5.2",
"postcss": "^8.4.37", "postcss": "^8.4.37",
"prettier": "^3.2.5", "prettier": "^3.2.5",