Skip to content

Commit 1bedda1

Browse files
committed
chore: Update linters and essential configurations
1 parent 993b854 commit 1bedda1

File tree

4 files changed

+93
-7
lines changed

4 files changed

+93
-7
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
tests/results/*
2+
3+
# Python
4+
__pycache__/
5+
*.py[cod]
6+
node_modules/

.pre-commit-config.yaml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ repos:
4545

4646
# Dockerfile linter
4747
- repo: https://github.com/hadolint/hadolint
48-
rev: v2.12.1-beta
48+
rev: v2.13.1-beta
4949
hooks:
5050
- id: hadolint
5151
args: [
@@ -61,8 +61,89 @@ repos:
6161

6262
# JSON5 Linter
6363
- repo: https://github.com/pre-commit/mirrors-prettier
64-
rev: v3.1.0
64+
rev: v4.0.0-alpha.8
6565
hooks:
6666
- id: prettier
6767
# https://prettier.io/docs/en/options.html#parser
6868
files: '.json5$'
69+
70+
71+
##########
72+
# PYTHON #
73+
##########
74+
75+
- repo: https://github.com/astral-sh/ruff-pre-commit
76+
rev: v0.8.4
77+
hooks:
78+
- id: ruff
79+
args: [--fix]
80+
types_or: [python, pyi]
81+
- id: ruff-format
82+
types_or: [python, pyi]
83+
args: [--config, format.quote-style = 'single', --config, line-length = 100]
84+
85+
- repo: https://github.com/pycqa/isort
86+
rev: 5.13.2
87+
hooks:
88+
- id: isort
89+
name: isort
90+
args: [--force-single-line, --profile=black]
91+
92+
- repo: https://github.com/asottile/add-trailing-comma
93+
rev: v3.1.0
94+
hooks:
95+
- id: add-trailing-comma
96+
97+
- repo: https://github.com/pre-commit/mirrors-autopep8
98+
rev: v2.0.4
99+
hooks:
100+
- id: autopep8
101+
args:
102+
- -i
103+
- --max-line-length=100
104+
105+
# Usage: http://pylint.pycqa.org/en/latest/user_guide/message-control.html
106+
- repo: https://github.com/PyCQA/pylint
107+
rev: v3.3.3
108+
hooks:
109+
- id: pylint
110+
args:
111+
- --disable=import-error # E0401. Locally you could not have all imports.
112+
- --disable=fixme # W0511. 'TODO' notations.
113+
- --disable=logging-fstring-interpolation # Conflict with "use a single formatting" WPS323
114+
- --disable=ungrouped-imports # ignore `if TYPE_CHECKING` case. Other do reorder-python-imports
115+
- --disable=R0801 # Similar lines in 2 files. Currently I don't think that it possible to DRY hooks unique files boilerplate
116+
117+
- repo: https://github.com/pre-commit/mirrors-mypy
118+
rev: v1.14.1
119+
hooks:
120+
- id: mypy
121+
additional_dependencies:
122+
- types-PyYAML
123+
args: [
124+
--ignore-missing-imports,
125+
--disallow-untyped-calls,
126+
--warn-redundant-casts,
127+
]
128+
129+
- repo: https://github.com/wemake-services/wemake-python-styleguide
130+
rev: 1.0.0
131+
hooks:
132+
- id: wemake-python-styleguide
133+
args:
134+
- --allowed-module-metadata=__all__ # Default to ''
135+
- --max-local-variables=6 # Default to 5
136+
- --max-returns=6 # Default to 5
137+
- --max-imports=15 # Default to 12
138+
# https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html
139+
- --extend-ignore=
140+
E501 <!-- line too long (> 79 characters). Use 100 -->
141+
WPS115 <!-- Found upper-case constant in a class. All occurrences are false positive -->
142+
WPS226 <!-- Found string literal over-use - append > 3 -->
143+
144+
145+
exclude: |
146+
(?x)
147+
# Ignore deprecated hook
148+
(^src/pre_commit_terraform/terraform_docs_replace.py$
149+
)

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@
77
"code-block-style": false
88
},
99
"markdown.validate.enabled": true,
10+
"python.analysis.extraPaths": [
11+
"./src"
12+
],
1013
}

pyproject.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ build-backend = 'hatchling.build'
99
name = 'pre-commit-terraform'
1010
classifiers = [
1111
'License :: OSI Approved :: MIT License',
12-
'Programming Language :: Python :: 2',
13-
'Programming Language :: Python :: 2.7',
1412
'Programming Language :: Python :: 3',
15-
'Programming Language :: Python :: 3.6',
16-
'Programming Language :: Python :: 3.7',
13+
'Programming Language :: Python :: 3 :: Only',
1714
'Programming Language :: Python :: Implementation :: CPython',
1815
'Programming Language :: Python :: Implementation :: PyPy',
1916
]
20-
description = 'Pre-commit hooks for terraform_docs_replace'
17+
description='Pre-commit hooks for terraform'
2118
dependencies = []
2219
dynamic = [
2320
'urls',

0 commit comments

Comments
 (0)