This repository was archived by the owner on Oct 29, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 11name : Lint
22on :
3- push :
4- branches :
5- - main
63 pull_request :
74
85jobs :
9- lint-with-pre-commit :
6+ autoformat :
107 runs-on : ubuntu-latest
118 steps :
129 - uses : actions/checkout@v3
@@ -20,13 +17,28 @@ jobs:
2017 - name : Install pre-commit
2118 run : pip install pre-commit
2219
23- - name : Run pre-commit hooks
24- id : pre-commit
25- run : pre-commit run --all-files
20+ - name : Run autoformatters
21+ run : pre-commit run autoformat --all-files || true
2622
2723 - name : Commit autoformatting changes back to pull request
28- if : always() && (steps.pre-commit.outcome == 'failure') && (github.event_name == 'pull_request')
2924 uses : devops-infra/action-commit-push@v0.9.0
3025 with :
3126 commit_message : " Autoformat via GitHub Actions"
3227 github_token : ${{ secrets.ADD_TO_PROJECT_PAT }}
28+
29+ lint :
30+ runs-on : ubuntu-latest
31+ steps :
32+ - uses : actions/checkout@v3
33+
34+ - uses : actions/setup-python@v4
35+ with :
36+ python-version : ' 3.10'
37+
38+ - name : Install pre-commit
39+ run : pip install pre-commit
40+
41+ - name : Run linters
42+ env :
43+ SKIP : autoformat
44+ run : pre-commit run --all-files
Original file line number Diff line number Diff line change 55 rev : v4.3.0
66 hooks :
77 - id : trailing-whitespace
8+ alias : autoformat
89 - id : end-of-file-fixer
10+ alias : autoformat
911 - id : check-yaml
1012 - id : requirements-txt-fixer
13+ alias : autoformat
1114 files : requirements.in
1215
1316 - repo : https://github.com/psf/black
1417 rev : 22.8.0
1518 hooks :
1619 - id : black
20+ alias : autoformat
1721 name : Format Python
1822 language_version : python3.10
1923
2024 - repo : https://github.com/pycqa/isort
2125 rev : 5.10.1
2226 hooks :
2327 - id : isort
28+ alias : autoformat
2429 name : Format Python imports
2530 args :
2631 - --profile=black
2934 rev : 6.8.0
3035 hooks :
3136 - id : pip-compile
37+ alias : autoformat
3238 name : Compile Python requirements
3339
3440
You can’t perform that action at this time.
0 commit comments