-
-
Notifications
You must be signed in to change notification settings - Fork 581
chore(checks): Init wemake-python-styleguide configuration #905
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
24dacab
Disable most obvious parts a.k.a. "init configuration"
MaxymVlasov 2a1c406
Add ignores for deprecated hooks
MaxymVlasov 6d8595c
Add wemake-python-styleguide pre-commit hook
MaxymVlasov af53405
Init config from chroot project. W/o fFIXME and useless for us options
MaxymVlasov 33770fd
fix WPS111
MaxymVlasov 2d87f5b
Ignore known issues which will not be fixed
MaxymVlasov 4932523
Ignore WPS115
MaxymVlasov e01faa2
Ignore WPS410
MaxymVlasov 17fdb38
Fix WPS407 — Forbid mutable constants on a module level.
MaxymVlasov 7d54fe4
Ignore 4 WPS324 violations
MaxymVlasov 0441b68
Fix fixable part of WPS324
MaxymVlasov 6c2c7af
Apply review suggestions
MaxymVlasov 2fc9c37
Apply review suggestions
MaxymVlasov 2c22b6f
Update .flake8
MaxymVlasov 3248618
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6687da9
Apply suggestions from code review
MaxymVlasov 6eb082a
Not try to fix WPS111 in a way that does not improve code
MaxymVlasov ad6a5c0
Merge branch 'master' into add_wemake-python-styleguide
MaxymVlasov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| [flake8] | ||
|
|
||
| # Print the total number of errors: | ||
| count = true | ||
|
|
||
| # Don't even try to analyze these: | ||
| extend-exclude = | ||
| # GitHub configs | ||
| .github, | ||
| # Cache files of MyPy | ||
| .mypy_cache, | ||
| # Cache files of pytest | ||
| .pytest_cache, | ||
| # Countless third-party libs in venvs | ||
| .tox, | ||
| # Occasional virtualenv dir | ||
| .venv, | ||
| # VS Code | ||
| .vscode, | ||
| # Metadata of `pip wheel` cmd is autogenerated | ||
| pip-wheel-metadata, | ||
|
|
||
| # IMPORTANT: avoid using ignore option, always use extend-ignore instead | ||
| # Completely and unconditionally ignore the following errors: | ||
| extend-ignore = | ||
| # Legitimate cases, no need to "fix" these violations: | ||
| # D202: No blank lines allowed after function docstring, conflicts with `ruff format` | ||
| D202, | ||
| # E203: whitespace before ':', conflicts with `ruff format` | ||
| E203, | ||
| # E501: "line too long", its function is replaced by `flake8-length` | ||
| E501, | ||
| # W505: "doc line too long", its function is replaced by `flake8-length` | ||
| W505, | ||
| # I: flake8-isort is drunk + we have isort integrated into pre-commit | ||
| I, | ||
| # WPS305: "Found f string" -- nothing bad about this | ||
| WPS305, | ||
| # WPS322: "Found incorrect multi-line string" -- false-positives with | ||
| # attribute docstrings. Ref: | ||
| # https://github.com/wemake-services/wemake-python-styleguide/issues/3056 | ||
| WPS322, | ||
| # WPS326: "Found implicit string concatenation" -- nothing bad about this | ||
| WPS326, | ||
| # WPS428: "Found statement that has no effect" -- false-positives with | ||
| # attribute docstrings. Ref: | ||
| # https://github.com/wemake-services/wemake-python-styleguide/issues/3056 | ||
| WPS428, | ||
| # WPS462: "Wrong multiline string usage" -- false-positives with | ||
| # attribute docstrings. Ref: | ||
| # https://github.com/wemake-services/wemake-python-styleguide/issues/3056 | ||
| WPS462, | ||
| # WPS300: "Forbid imports relative to the current folder" -- we use relative imports | ||
| WPS300, | ||
|
|
||
| # https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/formatter.html | ||
| #format = wemake | ||
|
|
||
| # Let's not overcomplicate the code: | ||
| max-complexity = 10 | ||
|
|
||
| # Accessibility/large fonts and PEP8 friendly. | ||
| # This is being flexibly extended through the `flake8-length`: | ||
| max-line-length = 79 | ||
|
|
||
| # Allow certain violations in certain files: | ||
| # Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future | ||
| per-file-ignores = | ||
| # The following ignores have been researched and should be considered permanent | ||
| # each should be preceded with an explanation of each of the error codes | ||
| # If other ignores are added for a specific file in the section following this, | ||
| # these will need to be added to that line as well. | ||
|
|
||
| tests/pytest/_cli_test.py: | ||
| # WPS431: "Forbid nested classes" -- this is a legitimate use case for tests | ||
| WPS431, | ||
| # WPS226: "Forbid the overuse of string literals" -- this is a legitimate use case for tests | ||
| WPS226, | ||
| # WPS115: "Require snake_case for naming class attributes" -- testing legitimate case, ignored in main code | ||
| WPS115, | ||
| # We will not spend time on fixing complexity in deprecated hook | ||
| src/pre_commit_terraform/terraform_docs_replace.py: WPS232 | ||
|
|
||
| # Count the number of occurrences of each error/warning code and print a report: | ||
| statistics = true | ||
|
|
||
| # ## Plugin-provided settings: ## | ||
|
|
||
| # flake8-eradicate | ||
| # E800: | ||
| eradicate-whitelist-extend = isort:\s+\w+ | ||
|
|
||
| # flake8-pytest-style | ||
| # PT001: | ||
| pytest-fixture-no-parentheses = true | ||
| # PT006: | ||
| pytest-parametrize-names-type = tuple | ||
| # PT007: | ||
| pytest-parametrize-values-type = tuple | ||
| pytest-parametrize-values-row-type = tuple | ||
| # PT023: | ||
| pytest-mark-no-parentheses = true | ||
|
|
||
| # wemake-python-styleguide | ||
| show-source = true | ||
|
|
||
| # WPS410: "Forbid some module-level variables" -- __all__ is a legitimate use case | ||
| allowed-module-metadata=__all__ | ||
|
MaxymVlasov marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.