-
-
Notifications
You must be signed in to change notification settings - Fork 582
chore: Update essential configurations #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
1bedda1
bc89992
35e564f
9d18d70
b040278
65b68f7
9cb7a8d
b05097e
aaebf9b
356d3c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,6 @@ | ||
| tests/results/* | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| node_modules/ | ||
MaxymVlasov marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ repos: | |
|
|
||
| # Dockerfile linter | ||
| - repo: https://github.com/hadolint/hadolint | ||
| rev: v2.12.1-beta | ||
| rev: v2.13.1-beta | ||
| hooks: | ||
| - id: hadolint | ||
| args: [ | ||
|
|
@@ -61,8 +61,89 @@ repos: | |
|
|
||
| # JSON5 Linter | ||
| - repo: https://github.com/pre-commit/mirrors-prettier | ||
| rev: v3.1.0 | ||
| rev: v4.0.0-alpha.8 | ||
MaxymVlasov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| hooks: | ||
| - id: prettier | ||
| # https://prettier.io/docs/en/options.html#parser | ||
| files: '.json5$' | ||
|
|
||
|
|
||
| ########## | ||
| # PYTHON # | ||
|
||
| ########## | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.8.4 | ||
| hooks: | ||
| - id: ruff | ||
|
||
| args: [--fix] | ||
| types_or: [python, pyi] | ||
| - id: ruff-format | ||
| types_or: [python, pyi] | ||
| args: [--config, format.quote-style = 'single', --config, line-length = 100] | ||
|
||
|
|
||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.13.2 | ||
| hooks: | ||
| - id: isort | ||
| name: isort | ||
| args: [--force-single-line, --profile=black] | ||
|
|
||
| - repo: https://github.com/asottile/add-trailing-comma | ||
|
||
| rev: v3.1.0 | ||
| hooks: | ||
| - id: add-trailing-comma | ||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-autopep8 | ||
|
||
| rev: v2.0.4 | ||
| hooks: | ||
| - id: autopep8 | ||
|
||
| args: | ||
| - -i | ||
| - --max-line-length=100 | ||
|
||
|
|
||
| # Usage: http://pylint.pycqa.org/en/latest/user_guide/message-control.html | ||
| - repo: https://github.com/PyCQA/pylint | ||
|
||
| rev: v3.3.3 | ||
| hooks: | ||
| - id: pylint | ||
| args: | ||
| - --disable=import-error # E0401. Locally you could not have all imports. | ||
|
||
| - --disable=fixme # W0511. 'TODO' notations. | ||
| - --disable=logging-fstring-interpolation # Conflict with "use a single formatting" WPS323 | ||
|
||
| - --disable=ungrouped-imports # ignore `if TYPE_CHECKING` case. Other do reorder-python-imports | ||
| - --disable=R0801 # Similar lines in 2 files. Currently I don't think that it possible to DRY hooks unique files boilerplate | ||
|
||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.14.1 | ||
| hooks: | ||
| - id: mypy | ||
| additional_dependencies: | ||
| - types-PyYAML | ||
|
||
| args: [ | ||
| --ignore-missing-imports, | ||
| --disallow-untyped-calls, | ||
| --warn-redundant-casts, | ||
|
||
| ] | ||
|
|
||
| - repo: https://github.com/wemake-services/wemake-python-styleguide | ||
| rev: 1.0.0 | ||
| hooks: | ||
| - id: wemake-python-styleguide | ||
| args: | ||
| - --allowed-module-metadata=__all__ # Default to '' | ||
| - --max-local-variables=6 # Default to 5 | ||
| - --max-returns=6 # Default to 5 | ||
| - --max-imports=15 # Default to 12 | ||
| # https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html | ||
| - --extend-ignore= | ||
| E501 <!-- line too long (> 79 characters). Use 100 --> | ||
|
||
| WPS115 <!-- Found upper-case constant in a class. All occurrences are false positive --> | ||
| WPS226 <!-- Found string literal over-use - append > 3 --> | ||
|
|
||
|
|
||
| exclude: | | ||
| (?x) | ||
| # Ignore deprecated hook | ||
| (^src/pre_commit_terraform/terraform_docs_replace.py$ | ||
|
||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,12 @@ build-backend = 'hatchling.build' | |
| name = 'pre-commit-terraform' | ||
| classifiers = [ | ||
| 'License :: OSI Approved :: MIT License', | ||
| 'Programming Language :: Python :: 2', | ||
| 'Programming Language :: Python :: 2.7', | ||
| 'Programming Language :: Python :: 3', | ||
| 'Programming Language :: Python :: 3.6', | ||
| 'Programming Language :: Python :: 3.7', | ||
|
||
| 'Programming Language :: Python :: 3 :: Only', | ||
| 'Programming Language :: Python :: Implementation :: CPython', | ||
| 'Programming Language :: Python :: Implementation :: PyPy', | ||
| ] | ||
| description = 'Pre-commit hooks for terraform_docs_replace' | ||
| description='Pre-commit hooks for terraform' | ||
|
||
| dependencies = [] | ||
| dynamic = [ | ||
| 'urls', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| """A runpy-style CLI entry-point module.""" | ||
|
|
||
| from sys import argv, exit as exit_with_return_code | ||
| from sys import argv | ||
| from sys import exit as exit_with_return_code | ||
|
|
||
| from ._cli import invoke_cli_app | ||
|
|
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will probably go away with a proper config. |
||
| return_code = invoke_cli_app(argv[1:]) | ||
| exit_with_return_code(return_code) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,11 +3,9 @@ | |
| from sys import stderr | ||
|
|
||
| from ._cli_parsing import initialize_argument_parser | ||
| from ._errors import ( | ||
| PreCommitTerraformBaseError, | ||
| PreCommitTerraformExit, | ||
| PreCommitTerraformRuntimeError, | ||
| ) | ||
| from ._errors import PreCommitTerraformBaseError | ||
| from ._errors import PreCommitTerraformExit | ||
| from ._errors import PreCommitTerraformRuntimeError | ||
| from ._structs import ReturnCode | ||
| from ._types import ReturnCodeType | ||
|
|
||
|
|
@@ -28,8 +26,7 @@ def invoke_cli_app(cli_args: list[str]) -> ReturnCodeType: | |
| raise | ||
| except PreCommitTerraformRuntimeError as unhandled_exc: | ||
| print( | ||
| f'App execution took an unexpected turn: {unhandled_exc !s}. ' | ||
| 'Exiting...', | ||
| f'App execution took an unexpected turn: {unhandled_exc !s}. ' 'Exiting...', | ||
|
||
| file=stderr, | ||
| ) | ||
| return ReturnCode.ERROR | ||
|
|
||
MaxymVlasov marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.