Skip to content

Commit 57901f6

Browse files
committed
adding pre-commit hooks. closes #6
1 parent c1fd203 commit 57901f6

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pre-commit-hooks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python 3.10
11+
uses: actions/setup-python@v1
12+
with:
13+
python-version: 3.10
14+
- name: Linting
15+
run: |
16+
pip install pre-commit
17+
pre-commit clean
18+
pre-commit autoupdate
19+
pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
files: '.py'
2+
exclude: '.git'
3+
default_stages: [commit]
4+
5+
repos:
6+
- repo: https://github.com/psf/black
7+
rev: 22.6.0
8+
hooks:
9+
- id: black
10+
11+
- repo: https://github.com/timothycrosley/isort
12+
rev: 5.10.1
13+
hooks:
14+
- id: isort
15+
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.3.0
18+
hooks:
19+
- id: trailing-whitespace
20+
- id: end-of-file-fixer
21+
- id: debug-statements

0 commit comments

Comments
 (0)