Skip to content

Commit

Permalink
Merge branch 'main' into docs/md
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed May 16, 2022
2 parents 735da9f + dd86f98 commit 9570bc4
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 37 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:
args: [--relative, --no-progress, --no-summary]
name: Spell check with cspell
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.3
rev: 0.15.0
hooks:
- id: check-github-workflows
- repo: https://github.com/pre-commit/pre-commit-hooks.git
Expand Down Expand Up @@ -124,7 +124,7 @@ repos:
# empty args needed in order to match mypy cli behavior
args: [--strict]
additional_dependencies:
- ansible-compat>=2.0.3
- ansible-compat>=2.0.4
- ansible-core
- enrich
- flaky
Expand All @@ -145,11 +145,11 @@ repos:
plugins/.*
)$
- repo: https://github.com/pycqa/pylint
rev: v2.13.8
rev: v2.14.0-b1
hooks:
- id: pylint
additional_dependencies:
- ansible-compat>=2.0.3
- ansible-compat>=2.0.4
- ansible-core
- docutils
- enrich
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# pip-compile --extra=docs --extra=test --no-annotate --output-file=requirements.txt --strip-extras setup.cfg
#
alabaster==0.7.12
ansible-compat==2.0.3
ansible-core==2.12.5
ansible-compat==2.0.4
ansible-core==2.13.0
ansible-pygments==0.1.1
astroid==2.11.5
attrs==21.4.0
Expand All @@ -18,7 +18,7 @@ cffi==1.15.0
charset-normalizer==2.0.12
click==8.1.3
commonmark==0.9.1
coverage==6.3.2
coverage==6.3.3
cryptography==37.0.2
dill==0.3.4
docutils==0.16
Expand Down Expand Up @@ -55,8 +55,8 @@ pycodestyle==2.8.0
pycparser==2.21
pyflakes==2.4.0
pygments==2.12.0
pylint==2.13.8
pyparsing==3.0.8
pylint==2.13.9
pyparsing==3.0.9
pyrsistent==0.18.1
pytest==7.1.2
pytest-cov==3.0.0
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ zip_safe = False

# These are required in actual runtime:
install_requires =
ansible-compat>=2.0.3 # GPLv3
ansible-compat>=2.0.4 # GPLv3
ansible-core>=2.12.0 # GPLv3
enrich>=1.2.6
jsonschema>=4.5.1 # MIT, first version to have ordered keys in output
Expand Down
2 changes: 0 additions & 2 deletions src/ansiblelint/_internal/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


# Derived rules are likely to want to access class members, so:
# pylint: disable=no-self-use
# pylint: disable=unused-argument
class BaseRule:
"""Root class used by Rules."""
Expand Down Expand Up @@ -96,7 +95,6 @@ def __lt__(self, other: "BaseRule") -> bool:
return self.id < other.id


# pylint: enable=no-self-use
# pylint: enable=unused-argument


Expand Down
6 changes: 3 additions & 3 deletions src/ansiblelint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def get_cli_parser() -> argparse.ArgumentParser:
choices=[
"rich",
"plain",
"rst",
"md",
"json",
"codeclimate",
"quiet",
Expand Down Expand Up @@ -500,11 +500,11 @@ def get_config(arguments: List[str]) -> Namespace:
parser = get_cli_parser()
options = parser.parse_args(arguments)

if options.listrules and options.format not in ["plain", "rich", "rst"]:
if options.listrules and options.format not in ["plain", "rich", "md"]:
parser.error(
f"argument -f: invalid choice: '{options.format}'. "
f"In combination with argument -L only 'plain', "
f"'rich' or 'rst' are supported with -f."
f"'rich' or 'md' are supported with -f."
)

file_config = load_config(options.config_file)
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def __getitem__(self, key: Any) -> Any:
def get(self, key: Any, default: Any = None) -> Any:
"""Provide compatibility subscriptable support."""
try:
return self.__getitem__(key)
return self[key]
except NotImplementedError:
return default

Expand Down
1 change: 0 additions & 1 deletion src/ansiblelint/formatters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def _format_path(self, path: Union[str, Path]) -> Union[str, Path]:
# Use os.path.relpath 'cause Path.relative_to() misbehaves
return os.path.relpath(path, start=self._base_dir)

# pylint: disable=no-self-use
def format(self, match: "MatchError") -> str:
"""Format a match error."""
return str(match)
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/meta_video_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def matchplay(
if not isinstance(video, dict):
results.append(
self.create_matcherror(
"Expected item in 'video_links' to be " "a dictionary",
"Expected item in 'video_links' to be a dictionary",
filename=file,
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/ansiblelint/schemas/ansible-navigator-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@
"required": [
"ansible-navigator"
],
"title": "ansible-navigator settings v2.0",
"title": "ansible-navigator settings v2.1",
"type": "object",
"version": "2.0"
"version": "2.1"
}
15 changes: 0 additions & 15 deletions test/eco/hardening.result
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ warn_list: # or 'skip_list' to silence them completely
- experimental # all rules tagged as experimental
- schema # Perform JSON Schema Validation for known lintable kinds.

Returned errors will not include exact line numbers, but they will mention
the schema name being used as a tag, like ``playbook-schema``,
``tasks-schema``.

This rule is not skippable and stops further processing of the file.

Schema bugs should be reported towards https://github.com/ansible/schemas
project instead of ansible-lint.

If incorrect schema was picked, you might want to either:

* move the file to standard location, so its file is detected correctly.
* use ``kinds:`` option in linter config to help it pick correct file type.




STDOUT:
Expand Down
2 changes: 1 addition & 1 deletion test/eco/zuul-jobs.result
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ roles/ensure-chart-testing/tasks/main.yaml:27: risky-file-permissions: File perm
roles/ensure-dhall/tasks/main.yaml:15: risky-file-permissions: File permissions unset or incorrect.
roles/ensure-go/tasks/install-go.yaml:12: risky-file-permissions: File permissions unset or incorrect.
roles/ensure-haskell-stack/tasks/main.yaml:11: unnamed-task: All tasks should be named.
roles/ensure-kubernetes/tasks/minikube.yaml:1: schema: False is not of type 'string' (schema[tasks])
roles/ensure-kubernetes/tasks/minikube.yaml:1: schema: True is not of type 'string' (schema[tasks])
roles/ensure-nimble/tasks/main.yaml:1: schema: 1 is not of type 'string' (schema[tasks])
roles/ensure-nimble/tasks/main.yaml:14: unnamed-task: All tasks should be named.
roles/ensure-packer/tasks/install-packer.yaml:21: risky-file-permissions: File permissions unset or incorrect.
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ setenv =
PIP_CONSTRAINT = /dev/null
commands =
# manual hook calls the optional pip-compile-upgrade hook
{envpython} -m pre_commit run --all-files --show-diff-on-failure --hook-stage manual pip-compile-upgrade
pre-commit run --all-files --show-diff-on-failure --hook-stage manual pip-compile-upgrade
# Update pre-commit hooks
pre-commit autoupdate
# We fail if files are modified at the end
git diff --exit-code

Expand Down

0 comments on commit 9570bc4

Please sign in to comment.