Skip to content

Commit 960c708

Browse files
Merge pull request #16 from jarrodmillman/precommit
Update pre-commit hooks
2 parents 9550354 + c25244d commit 960c708

File tree

5 files changed

+50
-32
lines changed

5 files changed

+50
-32
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
# for error classes selected below.
1212

1313
[flake8]
14-
max-line-length = 80
14+
max-line-length = 88
1515
select = C,E,F,W,B,B950
1616
ignore = E501, W503

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- '*.*'
6+
- "*.*"
77

88
jobs:
99
release:
@@ -14,8 +14,8 @@ jobs:
1414
- name: Setup Python 3.10
1515
uses: actions/setup-python@v2
1616
with:
17-
python-version: '3.10'
18-
architecture: 'x64'
17+
python-version: "3.10"
18+
architecture: "x64"
1919

2020
- name: Install flit
2121
run: pip install flit

.github/workflows/test.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ jobs:
1111
python-version: ["3.10"]
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: ${{ matrix.python-version }}
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
1919

20-
- uses: actions/cache@v2
21-
with:
22-
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
24-
restore-keys: |
25-
${{ runner.os }}-pip-
20+
- uses: actions/cache@v2
21+
with:
22+
path: ~/.cache/pip
23+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
24+
restore-keys: |
25+
${{ runner.os }}-pip-
2626
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
pip install ".[test]"
31-
pip install ".[lint]"
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install ".[test]"
31+
pip install ".[lint]"
3232
33-
- name: Lint
34-
run: pre-commit run --all-files --show-diff-on-failure --color always
33+
- name: Lint
34+
run: pre-commit run --all-files --show-diff-on-failure --color always
3535

36-
- name: Test
37-
run: |
38-
PYTHONPATH=. pytest
36+
- name: Test
37+
run: |
38+
PYTHONPATH=. pytest

.pre-commit-config.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,39 @@
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.1.0
6+
rev: v4.3.0
77
hooks:
8-
- id: check-yaml
9-
- id: end-of-file-fixer
108
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: debug-statements
11+
- id: check-ast
12+
- id: mixed-line-ending
13+
- id: check-yaml
14+
args: [--allow-multiple-documents]
15+
- id: check-json
16+
- id: check-toml
17+
- id: check-added-large-files
1118
- repo: https://github.com/psf/black
12-
rev: 22.3.0
19+
rev: 22.6.0
1320
hooks:
1421
- id: black
1522
- repo: https://gitlab.com/pycqa/flake8
16-
rev: 3.8.4
23+
rev: 5.0.4
1724
hooks:
1825
- id: flake8
1926
pass_filenames: true
2027
- repo: https://github.com/pycqa/isort
2128
rev: 5.10.1
2229
hooks:
2330
- id: isort
31+
- repo: https://github.com/asottile/pyupgrade
32+
rev: v2.37.3
33+
hooks:
34+
- id: pyupgrade
35+
args: [--py38-plus]
36+
- repo: https://github.com/pre-commit/mirrors-prettier
37+
rev: v2.7.1
38+
hooks:
39+
- id: prettier
40+
files: \.(html|md|yml|yaml)
41+
args: [--prose-wrap=preserve]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ the imports. However, if used with the above pattern, this results in code
7979
duplication, as you now need to declare your submodules and attributes in two places.
8080

8181
You can infer the `submodules` and `submod_attrs` arguments (explicitly provided
82-
above to `lazy.attach`) from a stub adjacent to the `.py` file by using the
82+
above to `lazy.attach`) from a stub adjacent to the `.py` file by using the
8383
`lazy.attach_stub` function.
8484

8585
Carrying on with the example above:
@@ -110,7 +110,7 @@ to include `*.pyi` files.
110110
### Early failure
111111

112112
With lazy loading, missing imports no longer fail upon loading the
113-
library. During development and testing, you can set the `EAGER_IMPORT`
113+
library. During development and testing, you can set the `EAGER_IMPORT`
114114
environment variable to disable lazy loading.
115115

116116
### External libraries

0 commit comments

Comments
 (0)