Skip to content

Commit 3b156e5

Browse files
authored
Merge pull request #98 from waynesun09/pre_commit_black
Adopt black in pre-commit
2 parents adaf63a + f56d8f2 commit 3b156e5

78 files changed

Lines changed: 2847 additions & 2528 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pull_request.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
python-version: [3.6, 3.8, 3.9, "3.10"]
1515
steps:
1616
- name: Checkout Pylero
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818

1919
- name: Set Up Python-${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v3
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323

@@ -26,5 +26,7 @@ jobs:
2626
pip install -U pip
2727
pip install -U -r requirements.txt
2828
pip install .
29+
2930
- name: Pre Commit Checks
30-
uses: pre-commit/action@v2.0.0
31+
uses: pre-commit/action@v3.0.0
32+
if: ${{ matrix.python-version != '3.6' }}

.pre-commit-config.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
# configuration for pre-commit git hooks
2-
files: ^(src/pylero)
2+
exclude: '^docs'
33
repos:
44
- repo: https://github.com/asottile/reorder_python_imports
5-
rev: v2.6.0
5+
rev: v3.8.2
66
hooks:
77
- id: reorder-python-imports
8-
language_version: python3
98
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.0.1
9+
rev: v4.3.0
1110
hooks:
1211
- id: trailing-whitespace
13-
language_version: python3
1412
- id: end-of-file-fixer
15-
language_version: python3
1613
- id: debug-statements
17-
language_version: python3
18-
- repo: https://github.com/pycqa/flake8
19-
rev: 3.9.2
14+
- id: detect-private-key
15+
- repo: https://github.com/psf/black
16+
rev: 22.6.0
2017
hooks:
21-
- id: flake8
22-
language_version: python3
18+
- id: black

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ $ pip install pre-commit
292292
$ pre-commit autoupdate && pre-commit run -a
293293
```
294294

295-
Pre-commit will ensure that the changes you made are not in violation of PEP8 standards.
295+
Pre-commit will ensure that the changes you made are not in violation of PEP8 standards and automatically apply black fixes.
296296

297-
We recommend `autopep8` to fix any pre-commit failures by running below or you are free to use any formatters which can resolve pre-commit failures with least possible diff.
297+
We recommend `black` to automatically fix any pre-commit failures.
298298

299299
``` python
300-
$ pip install autopep8
301-
$ autopep8 --in-place <edited_file.py>
300+
$ pip install black
301+
$ black <edited_file.py>
302302
```
303303

304304
## Fedora RPM package build

0 commit comments

Comments
 (0)