-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Kate Case <[email protected]>
- Loading branch information
Showing
20 changed files
with
92 additions
and
93 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,7 +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" | ||
|
||
|
@@ -12,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", | ||
|
@@ -34,7 +34,7 @@ classifiers = [ | |
"Topic :: System :: Systems Administration", | ||
"Topic :: Software Development :: Quality Assurance", | ||
"Topic :: Software Development :: Testing", | ||
"Topic :: Utilities" | ||
"Topic :: Utilities", | ||
] | ||
keywords = ["ansible", "lint"] | ||
|
||
|
@@ -115,7 +115,7 @@ module = [ | |
"ansiblelint._version", # generated | ||
"license_expression", | ||
"ruamel.yaml", | ||
"yamllint.*" | ||
"yamllint.*", | ||
] | ||
ignore_missing_imports = true | ||
ignore_errors = true | ||
|
@@ -130,7 +130,7 @@ extension-pkg-allow-list = ["black.parsing"] | |
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"] | ||
|
@@ -151,10 +151,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] | ||
|
@@ -193,7 +193,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: | ||
|
@@ -214,23 +214,26 @@ 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 | ||
# testpaths = | ||
xfail_strict = true | ||
|
||
[tool.ruff] | ||
ignore = [ | ||
target-version = "py310" | ||
# Same as Black. | ||
line-length = 88 | ||
lint.ignore = [ | ||
"D203", # incompatible with D211 | ||
"D213", # incompatible with D212 | ||
"E501", # we use black | ||
|
@@ -246,42 +249,38 @@ ignore = [ | |
"FBT003", | ||
"PLR", | ||
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar` | ||
"TRY", | ||
"PERF203", | ||
"PD011", # We are not using pandas, any .values attributes are unrelated | ||
"PLW0603" # global lock file in cache dir | ||
"PLW0603", # global lock file in cache dir | ||
] | ||
select = ["ALL"] | ||
target-version = "py310" | ||
# Same as Black. | ||
line-length = 88 | ||
lint.select = ["ALL"] | ||
|
||
[tool.ruff.flake8-builtins] | ||
[tool.ruff.lint.flake8-builtins] | ||
builtins-ignorelist = ["id"] | ||
|
||
[tool.ruff.flake8-pytest-style] | ||
[tool.ruff.lint.flake8-pytest-style] | ||
parametrize-values-type = "tuple" | ||
|
||
[tool.ruff.isort] | ||
[tool.ruff.lint.isort] | ||
known-first-party = ["ansiblelint"] | ||
|
||
[tool.ruff.mccabe] | ||
[tool.ruff.lint.mccabe] | ||
# Implicit 10 is too low for our codebase, even black uses 18 as default. | ||
max-complexity = 20 | ||
|
||
[tool.ruff.per-file-ignores] | ||
[tool.ruff.lint.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] | ||
dependencies = {file = [".config/requirements.in"]} | ||
optional-dependencies.docs = {file = [".config/requirements-docs.in"]} | ||
optional-dependencies.test = {file = [".config/requirements-test.in"]} | ||
dependencies = { file = [".config/requirements.in"] } | ||
optional-dependencies.docs = { file = [".config/requirements-docs.in"] } | ||
optional-dependencies.test = { file = [".config/requirements-test.in"] } | ||
|
||
[tool.setuptools_scm] | ||
local_scheme = "no-local-version" | ||
|
@@ -295,5 +294,5 @@ git_describe_command = [ | |
"--tags", | ||
"--long", | ||
"--match", | ||
"v*.*" | ||
"v*.*", | ||
] |
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
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
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
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
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
Oops, something went wrong.
@ssbarnea , noticed this while digging into this bug report. I may be missing something, but this appears to be buggy in that the python order of precedence would apply the
not
before theor
, so at best, theor
portion is superfluous as it implies thenot
portion would have already beenTrue
so the condition would short-circuit.But python isn't my first language so i may be missing a crucial detail...