Skip to content

Commit

Permalink
chore: auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 1, 2022
1 parent f2f085e commit e2049ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ansiblelint/rules/role_name.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Role names are now limited to contain only lowercase alphanumeric characters,
plus underline and start with an alpha character.

* `role-name[path]` Avoid using paths when importing roles. You should only
- `role-name[path]` Avoid using paths when importing roles. You should only
rely on Ansible's ability to find the role and refer to them using fully
qualified names.

Expand All @@ -13,7 +13,7 @@ plus underline and start with an alpha character.
---
- name: Bad use of variable inside hosts block (wrong assumption of it being defined)
include_role:
name: subdirectory/role_name # <-- don't keep roles in subdirectories
name: subdirectory/role_name # <-- don't keep roles in subdirectories
```

## Correct code
Expand All @@ -27,5 +27,5 @@ being one of them.
---
- name: Good use of variable inside hosts, without assumptions
include_role:
name: my_namespace.my_collection.my_role # explicit fqcn role name
name: my_namespace.my_collection.my_role # explicit fqcn role name
```
4 changes: 2 additions & 2 deletions src/ansiblelint/rules/role_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from pathlib import Path
from typing import TYPE_CHECKING, Any

from ansiblelint.constants import ROLE_IMPORT_ACTION_NAMES
from ansiblelint.file_utils import Lintable
from ansiblelint.rules import AnsibleLintRule
from ansiblelint.utils import parse_yaml_from_file
from ansiblelint.constants import ROLE_IMPORT_ACTION_NAMES

if TYPE_CHECKING:
from ansiblelint.errors import MatchError
Expand Down Expand Up @@ -74,7 +74,7 @@ def matchtask(
filename=file,
linenumber=task["__line__"],
tag=f"{self.id}[path]",
)
)
)
return results

Expand Down

0 comments on commit e2049ed

Please sign in to comment.