Skip to content

Commit 6216ae0

Browse files
authored
Use flake8-toml-config (#53)
2 parents de1ca05 + 8ff638d commit 6216ae0

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ repos:
4646
hooks:
4747
- id: "flake8"
4848
additional_dependencies:
49+
- "flake8-toml-config==1.0.0"
4950
- "flake8-bugbear==24.12.12"
5051

5152
- repo: "https://github.com/editorconfig-checker/editorconfig-checker"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Development
2+
-----------
3+
4+
* Migrate the flake8 configuration to ``pyproject.toml`` using
5+
the `flake8-toml-config <https://github.com/kurtmckee/flake8-toml-config>`_ plugin.

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ source = [
7272
fail_under = 100
7373

7474

75+
# flake8
76+
# ------
77+
78+
[tool.flake8]
79+
max-line-length = 80
80+
extend-select = ["B950"]
81+
extend-ignore = ["E203", "E501", "E701"]
82+
83+
7584
# isort
7685
# -----
7786

src/pelican/plugins/precompress/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def get_settings(instance) -> dict[str, bool | pathlib.Path | set[str]]:
109109
log.warning("brotli, gzip, and zstandard file extensions are excluded.")
110110
for extension in excluded_extensions:
111111
log.warning(
112-
f'Removing "{extension}" from the set of text file extensions to pre-compress.'
112+
f'Removing "{extension}" from the set of file extensions to pre-compress.'
113113
)
114114
settings["PRECOMPRESS_TEXT_EXTENSIONS"].remove(extension)
115115

@@ -123,7 +123,7 @@ def get_settings(instance) -> dict[str, bool | pathlib.Path | set[str]]:
123123
log.warning("File extensions must start with a period.")
124124
for extension in invalid_extensions:
125125
log.warning(
126-
f'Removing "{extension}" from the set of text file extensions to pre-compress.'
126+
f'Removing "{extension}" from the set of file extensions to pre-compress.'
127127
)
128128
settings["PRECOMPRESS_TEXT_EXTENSIONS"].remove(extension)
129129

tox.ini

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,3 @@ passenv =
8787
commands =
8888
poetry version "{env:VERSION}"
8989
scriv collect
90-
91-
92-
[flake8]
93-
max-line-length = 88
94-
extend-ignore =
95-
E203,
96-
E501,

0 commit comments

Comments
 (0)