Skip to content

Commit bccad90

Browse files
authored
Whc/add linter (#81)
Add the linter back using a different changed-files plugin which doesn't have permission issues on pytorch/ org. Also change the linter job to use py 3.10 to match our unit test runner.
1 parent ebbb1cb commit bccad90

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/lint.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: lint-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
8+
cancel-in-progress: true
9+
10+
defaults:
11+
run:
12+
shell: bash -l -eo pipefail {0}
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ['3.10']
20+
steps:
21+
- name: Check out repo
22+
uses: actions/checkout@v3
23+
- name: Setup python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Update pip
28+
run: python -m pip install --upgrade pip
29+
- name: Install lint utilities
30+
run: |
31+
python -m pip install pre-commit
32+
pre-commit install-hooks
33+
- name: Get changed files
34+
id: changed-files
35+
uses: tj-actions/[email protected]
36+
- name: Lint modified files
37+
run: pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }}

0 commit comments

Comments
 (0)