Skip to content

Commit

Permalink
Enable pylint (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 27, 2023
1 parent bc4b97c commit dc0b0c6
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ repos:
- flake8-print>=5.0
- flake8-pytest-style>=1.2.2
- flake8-future-annotations>=0.0.3
- repo: https://github.com/pycqa/pylint
rev: v2.17.1
hooks:
- id: pylint
args:
- --output-format=colorized
additional_dependencies:
- ansible-core
- pytest
- repo: https://github.com/jazzband/pip-tools
rev: 6.12.3
hooks:
Expand Down
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,65 @@ documentation = "https://github.com/ansible-community/pytest-ansible"
repository = "https://github.com/ansible-community/pytest-ansible"
changelog = "https://github.com/ansible-community/pytest-ansible/releases"

[tool.pylint.MAIN]
extension-pkg-allow-list = ["black.parsing"]

[tool.pylint.IMPORTS]
preferred-modules = ["py:pathlib", "unittest:pytest"]

[tool.pylint."MESSAGES CONTROL"]
# increase from default is 50 which is too aggressive
max-statements = 60
disable = [
# On purpose disabled as we rely on black
"line-too-long",
# https://github.com/PyCQA/pylint/issues/850
"cyclic-import",
# https://github.com/PyCQA/pylint/issues/8453
"preferred-module",
# Temporarily disabled until we fix them:
"bare-except",
"consider-using-f-string",
"duplicate-code",
"fixme",
"implicit-str-concat",
"import-error",
"import-outside-toplevel",
"invalid-name",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-else-raise",
"no-else-return",
"no-member",
"no-name-in-module",
"not-callable",
"notimplemented-raised",
"pointless-statement",
"protected-access",
"redefined-outer-name",
"super-with-arguments",
"too-few-public-methods",
"too-many-branches",
"too-many-locals",
"too-many-statements",
"undefined-loop-variable",
"unexpected-keyword-arg",
"ungrouped-imports",
"unnecessary-comprehension",
"unnecessary-pass",
"unused-argument",
"unused-import",
"unused-variable",
"use-a-generator",
"use-dict-literal",
"use-list-literal",
"used-before-assignment",
"useless-object-inheritance",
"using-constant-test",
"wrong-import-order",
]

[tool.setuptools.dynamic]
optional-dependencies.test = { file = [".config/requirements-test.txt"] }
optional-dependencies.lock = { file = [".config/requirements-lock.txt"] }
Expand Down

0 comments on commit dc0b0c6

Please sign in to comment.