Skip to content

Commit

Permalink
Merge pull request #98 from waynesun09/pre_commit_black
Browse files Browse the repository at this point in the history
Adopt black in pre-commit
  • Loading branch information
leelavg committed Sep 17, 2022
2 parents adaf63a + f56d8f2 commit 3b156e5
Show file tree
Hide file tree
Showing 78 changed files with 2,847 additions and 2,528 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/pull_request.yml
Expand Up @@ -14,10 +14,10 @@ jobs:
python-version: [3.6, 3.8, 3.9, "3.10"]
steps:
- name: Checkout Pylero
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set Up Python-${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -26,5 +26,7 @@ jobs:
pip install -U pip
pip install -U -r requirements.txt
pip install .
- name: Pre Commit Checks
uses: pre-commit/action@v2.0.0
uses: pre-commit/action@v3.0.0
if: ${{ matrix.python-version != '3.6' }}
18 changes: 7 additions & 11 deletions .pre-commit-config.yaml
@@ -1,22 +1,18 @@
# configuration for pre-commit git hooks
files: ^(src/pylero)
exclude: '^docs'
repos:
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
rev: v3.8.2
hooks:
- id: reorder-python-imports
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: trailing-whitespace
language_version: python3
- id: end-of-file-fixer
language_version: python3
- id: debug-statements
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
- id: detect-private-key
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: flake8
language_version: python3
- id: black
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -292,13 +292,13 @@ $ pip install pre-commit
$ pre-commit autoupdate && pre-commit run -a
```

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

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.
We recommend `black` to automatically fix any pre-commit failures.

``` python
$ pip install autopep8
$ autopep8 --in-place <edited_file.py>
$ pip install black
$ black <edited_file.py>
```

## Fedora RPM package build
Expand Down

0 comments on commit 3b156e5

Please sign in to comment.