File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed
Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ name : pre-commit
2+
3+ on :
4+ pull_request :
5+ push :
6+ branches : [main]
7+
8+ jobs :
9+ pre-commit :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v5
18+ with :
19+ python-version : " 3.12"
20+
21+ - name : Run pre-commit hooks
22+ uses : pre-commit/action@v3.0.1
Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : https://github.com/pre-commit/pre-commit-hooks
3+ rev : v4.5.0
4+ hooks :
5+ - id : trailing-whitespace
6+ - id : end-of-file-fixer
7+ - id : check-json
8+ - id : check-merge-conflict
9+ - id : check-case-conflict
10+ - id : detect-private-key
11+
12+ - repo : https://github.com/astral-sh/ruff-pre-commit
13+ rev : v0.11.6
14+ hooks :
15+ - id : ruff
16+ args : [--fix]
17+ - id : ruff-format
Original file line number Diff line number Diff line change @@ -153,3 +153,17 @@ following resource allocation attribute types.
153153
154154By submitting a Resource Allocation Change Request and editing those attributes
155155a PI can request a change in their quota.
156+
157+ ## Pre-commit hooks
158+ ```
159+ pip install pre-commit
160+ ```
161+ Pre-commit runs tools like:
162+ - [ Ruff] ( https://docs.astral.sh/ruff/ ) — fast linter and fixer
163+ - Basic checks like trailing whitespace removal, JSON validation, and more.
164+
165+ To set up Git hook locally:
166+ ```
167+ pre-commit install
168+ ```
169+ After this, every time you make a commit, the hooks will run automatically!
You can’t perform that action at this time.
0 commit comments