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 1
1
name : Lint
2
2
on :
3
- push :
4
- branches :
5
- - main
6
3
pull_request :
7
4
8
5
jobs :
9
- lint-with-pre-commit :
6
+ autoformat :
10
7
runs-on : ubuntu-latest
11
8
steps :
12
9
- uses : actions/checkout@v3
@@ -20,13 +17,28 @@ jobs:
20
17
- name : Install pre-commit
21
18
run : pip install pre-commit
22
19
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
26
22
27
23
- name : Commit autoformatting changes back to pull request
28
- if : always() && (steps.pre-commit.outcome == 'failure') && (github.event_name == 'pull_request')
29
24
uses :
devops-infra/[email protected]
30
25
with :
31
26
commit_message : " Autoformat via GitHub Actions"
32
27
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 5
5
rev : v4.3.0
6
6
hooks :
7
7
- id : trailing-whitespace
8
+ alias : autoformat
8
9
- id : end-of-file-fixer
10
+ alias : autoformat
9
11
- id : check-yaml
10
12
- id : requirements-txt-fixer
13
+ alias : autoformat
11
14
files : requirements.in
12
15
13
16
- repo : https://github.com/psf/black
14
17
rev : 22.8.0
15
18
hooks :
16
19
- id : black
20
+ alias : autoformat
17
21
name : Format Python
18
22
language_version : python3.10
19
23
20
24
- repo : https://github.com/pycqa/isort
21
25
rev : 5.10.1
22
26
hooks :
23
27
- id : isort
28
+ alias : autoformat
24
29
name : Format Python imports
25
30
args :
26
31
- --profile=black
29
34
rev : 6.8.0
30
35
hooks :
31
36
- id : pip-compile
37
+ alias : autoformat
32
38
name : Compile Python requirements
33
39
34
40
You can’t perform that action at this time.
0 commit comments