Skip to content

Commit eaf81e2

Browse files
authored
Merge pull request #21 from honno/black-pre-commit
Introduce `pre-commit` with `isort`/`black`/`autoflake`
2 parents f7aa5fc + 73f4eca commit eaf81e2

37 files changed

+5110
-2607
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
3833f26594cd838213ee6602142a12003073ae7f
2+
6621cacf0feed4a25f37ccddb9cc9f1b0d27157f

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Linting
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: [3.8]
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Run pre-commit hook
20+
uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/myint/autoflake
3+
rev: v2.0.0
4+
hooks:
5+
- id: autoflake
6+
args: ["--in-place"]
7+
exclude: ^torch_np/tests/numpy_tests/
8+
- repo: https://github.com/timothycrosley/isort
9+
rev: 5.11.4
10+
hooks:
11+
- id: isort
12+
args: ["--profile", "black", "--filter-files"]
13+
exclude: ^torch_np/tests/numpy_tests/
14+
- repo: https://github.com/psf/black
15+
rev: 22.12.0
16+
hooks:
17+
- id: black
18+
exclude: ^torch_np/tests/numpy_tests/

0 commit comments

Comments
 (0)