forked from ansible/ansible-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration and editable installs | ||
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme | ||
|
||
"setuptools_scm[toml] >= 7.0.5" # required for "no-local-version" scheme | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
@@ -13,9 +12,9 @@ dynamic = ["version", "dependencies", "optional-dependencies"] | |
name = "ansible-lint" | ||
description = "Checks playbooks for practices and behavior that could potentially be improved" | ||
readme = "README.md" | ||
authors = [{ "name" = "Will Thames", "email" = "[email protected]" }] | ||
maintainers = [{ "name" = "Ansible by Red Hat", "email" = "[email protected]" }] | ||
license = { text = "GPLv3+" } | ||
authors = [{"name" = "Will Thames", "email" = "[email protected]"}] | ||
maintainers = [{"name" = "Ansible by Red Hat", "email" = "[email protected]"}] | ||
license = {text = "GPLv3+"} | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
|
@@ -36,19 +35,19 @@ classifiers = [ | |
"Topic :: System :: Systems Administration", | ||
"Topic :: Software Development :: Quality Assurance", | ||
"Topic :: Software Development :: Testing", | ||
"Topic :: Utilities", | ||
"Topic :: Utilities" | ||
] | ||
keywords = ["ansible", "lint"] | ||
|
||
[project.scripts] | ||
ansible-lint = "ansiblelint.__main__:_run_cli_entrypoint" | ||
|
||
[project.urls] | ||
homepage = "https://github.com/ansible/ansible-lint" | ||
documentation = "https://ansible.readthedocs.io/projects/lint/" | ||
repository = "https://github.com/ansible/ansible-lint" | ||
changelog = "https://github.com/ansible/ansible-lint/releases" | ||
|
||
[project.scripts] | ||
ansible-lint = "ansiblelint.__main__:_run_cli_entrypoint" | ||
|
||
[tool.black] | ||
target-version = ["py39"] | ||
|
||
|
@@ -57,14 +56,6 @@ skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata" | |
# indention is a typo in ruamel.yaml's API | ||
ignore-words-list = "indention" | ||
|
||
[tool.coverage.run] | ||
source = ["src"] | ||
# Do not use branch until bug is fixes: | ||
# https://github.com/nedbat/coveragepy/issues/605 | ||
# branch = true | ||
parallel = true | ||
concurrency = ["multiprocessing", "thread"] | ||
|
||
# Keep this default because xml/report do not know to use load it from config file: | ||
# data_file = ".coverage" | ||
[tool.coverage.paths] | ||
|
@@ -81,6 +72,14 @@ skip_empty = true | |
ignore_errors = true | ||
show_missing = true | ||
|
||
[tool.coverage.run] | ||
source = ["src"] | ||
# Do not use branch until bug is fixes: | ||
# https://github.com/nedbat/coveragepy/issues/605 | ||
# branch = true | ||
parallel = true | ||
concurrency = ["multiprocessing", "thread"] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
# add_imports = "from __future__ import annotations" | ||
|
@@ -117,23 +116,22 @@ module = [ | |
"ansiblelint._version", # generated | ||
"license_expression", | ||
"ruamel.yaml", | ||
"yamllint.*", | ||
"yamllint.*" | ||
] | ||
ignore_missing_imports = true | ||
ignore_errors = true | ||
|
||
[tool.pylint.MAIN] | ||
extension-pkg-allow-list = ["black.parsing"] | ||
|
||
[tool.pylint.IMPORTS] | ||
preferred-modules = ["py:pathlib", "unittest:pytest"] | ||
|
||
[tool.pylint.MAIN] | ||
extension-pkg-allow-list = ["black.parsing"] | ||
|
||
[tool.pylint.MASTER] | ||
bad-names = [ | ||
# spell-checker:ignore linenumber | ||
"linenumber", # use lineno instead | ||
"line_number", # use lineno instead | ||
|
||
"line_number" # use lineno instead | ||
] | ||
# pylint defaults + f,fh,v,id | ||
good-names = ["i", "j", "k", "Run", "_", "f", "fh", "v", "id", "T"] | ||
|
@@ -154,10 +152,10 @@ disable = [ | |
# https://github.com/PyCQA/pylint/issues/850 | ||
"cyclic-import", | ||
# https://github.com/PyCQA/pylint/issues/8453 | ||
"preferred-module", | ||
"preferred-module" | ||
] | ||
enable = [ | ||
"useless-suppression", # Identify unneeded pylint disable statements | ||
"useless-suppression" # Identify unneeded pylint disable statements | ||
] | ||
|
||
[tool.pylint.REPORTING] | ||
|
@@ -196,7 +194,7 @@ filterwarnings = [ | |
# https://github.com/ansible/ansible/issues/81906 | ||
"ignore:'importlib.abc.TraversableResources' is deprecated and slated for removal in Python 3.14:DeprecationWarning", | ||
# https://github.com/ansible/ansible/pull/80968 | ||
"ignore:Attribute s is deprecated and will be removed in Python 3.14; use value instead:DeprecationWarning", | ||
"ignore:Attribute s is deprecated and will be removed in Python 3.14; use value instead:DeprecationWarning" | ||
] | ||
junit_duration_report = "call" | ||
# Our github annotation parser from .github/workflows/tox.yml requires xunit1 format. Ref: | ||
|
@@ -217,15 +215,15 @@ norecursedirs = [ | |
"collections", | ||
"dist", | ||
"docs", | ||
"src/ansible_lint.egg-info", | ||
"src/ansible_lint.egg-info" | ||
] | ||
python_files = [ | ||
"test_*.py", | ||
# Ref: https://docs.pytest.org/en/latest/reference.html#confval-python_files | ||
# Needed to discover legacy nose test modules: | ||
"Test*.py", | ||
# Needed to discover embedded Rule tests | ||
"rules/*.py", | ||
"rules/*.py" | ||
] | ||
# Using --pyargs instead of testpath as we embed some tests | ||
# See: https://github.com/pytest-dev/pytest/issues/6451#issuecomment-687043537 | ||
|
@@ -251,17 +249,13 @@ ignore = [ | |
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` | ||
"TRY", | ||
"PERF203", | ||
"PD011", # We are not using pandas, any .values attributes are unrelated | ||
"PD011" # We are not using pandas, any .values attributes are unrelated | ||
] | ||
select = ["ALL"] | ||
target-version = "py39" | ||
# Same as Black. | ||
line-length = 88 | ||
|
||
[tool.ruff.mccabe] | ||
# Implicit 10 is too low for our codebase, even black uses 18 as default. | ||
max-complexity = 20 | ||
|
||
[tool.ruff.flake8-builtins] | ||
builtins-ignorelist = ["id"] | ||
|
||
|
@@ -271,20 +265,24 @@ parametrize-values-type = "tuple" | |
[tool.ruff.isort] | ||
known-first-party = ["ansiblelint"] | ||
|
||
[tool.ruff.mccabe] | ||
# Implicit 10 is too low for our codebase, even black uses 18 as default. | ||
max-complexity = 20 | ||
|
||
[tool.ruff.per-file-ignores] | ||
"test/**/*.py" = ["S"] | ||
"src/ansiblelint/rules/*.py" = ["S"] | ||
"src/ansiblelint/testing/*.py" = ["S"] | ||
# Temporary disabled until we fix them: | ||
"src/ansiblelint/{utils,file_utils,runner,loaders,constants,config,cli,_mockings}.py" = [ | ||
"PTH", | ||
"PTH" | ||
] | ||
|
||
[tool.setuptools.dynamic] | ||
optional-dependencies.docs = { file = [".config/docs-requirements.txt"] } | ||
optional-dependencies.test = { file = [".config/test-requirements.txt"] } | ||
optional-dependencies.lock = { file = [".config/lock-requirements.txt"] } | ||
dependencies = { file = [".config/runtime-requirements.txt"] } | ||
dependencies = {file = [".config/runtime-requirements.txt"]} | ||
optional-dependencies.docs = {file = [".config/docs-requirements.txt"]} | ||
optional-dependencies.test = {file = [".config/test-requirements.txt"]} | ||
optional-dependencies.lock = {file = [".config/lock-requirements.txt"]} | ||
|
||
[tool.setuptools_scm] | ||
local_scheme = "no-local-version" | ||
|
@@ -298,5 +296,5 @@ git_describe_command = [ | |
"--tags", | ||
"--long", | ||
"--match", | ||
"v*.*", | ||
"v*.*" | ||
] |