Skip to content

Commit fa5c508

Browse files
committed
add .pre-commit-config.yaml
1 parent 9a7c884 commit fa5c508

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

.flake8

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
pip install .
3838
pip install -r requirements-dev.txt
3939
- name: Lint with flake8
40-
run: flake8 .
40+
run: flake8 --max-line-length=120
4141
- name: Run tests and collect coverage
4242
run: |
4343
coverage run --source=tests,clang_tools -m pytest

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: 1f6de3d70391131fac4b911ae913c568e571e34e
4+
hooks:
5+
- id: trailing-whitespace
6+
exclude: \.output
7+
- id: end-of-file-fixer
8+
exclude: \.(cp?p?$|output)
9+
- id: check-docstring-first
10+
- id: check-added-large-files
11+
- id: check-yaml
12+
- id: debug-statements
13+
- id: requirements-txt-fixer
14+
- repo: https://github.com/asottile/reorder_python_imports
15+
rev: v3.7.0
16+
hooks:
17+
- id: reorder-python-imports
18+
language_version: python3
19+
- repo: https://github.com/asottile/pyupgrade
20+
rev: v1.16.1
21+
hooks:
22+
- id: pyupgrade
23+
- repo: https://github.com/pycqa/flake8
24+
rev: '4.0.1'
25+
hooks:
26+
- id: flake8
27+
args: [--max-line-length=120]
28+
- repo: local
29+
hooks:
30+
- id: tests
31+
name: tests
32+
entry: bash -c "pip install . && pytest -v -xxx"
33+
description: Run all tests
34+
language: system
35+
types: [python]

0 commit comments

Comments
 (0)