Skip to content

Commit 3434e3f

Browse files
authored
linter action (#119)
1 parent d4011ea commit 3434e3f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/lint.yaml

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

0 commit comments

Comments
 (0)