Skip to content

Commit

Permalink
Fix linters checks
Browse files Browse the repository at this point in the history
Since we already have old-style unittest, leaving it as is till mass
migration to pytest. And ingoring raised by this choice warnings.
  • Loading branch information
Dmitriy Rabotyagov committed May 19, 2021
1 parent b8b427a commit cdbee00
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ per-file-ignores =
test/TestMetaTagValid.py: PT009 D100 D101 D102
test/TestMetaVideoLinks.py: PT009 D100 D101 D102
test/TestNoFormattingInWhenRule.py: PT009 D100 D101 D102
test/TestNoLogPasswordsRule.py: PT009 D100 D101 D102
test/TestOctalPermissions.py: PT009 D100 D101 D102
test/TestPackageIsNotLatest.py: PT009 D100 D101 D102
test/TestPretaskIncludePlaybook.py: D100 D103
Expand Down
4 changes: 3 additions & 1 deletion src/ansiblelint/rules/NoLogPasswordsRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ def matchtask(
# No no_log and no_log: False behave the same way
# and should return a failure (return True), so we
# need to invert the boolean
return bool(has_password and not convert_to_boolean(task['action'].get('no_log', False)))
return bool(
has_password and not convert_to_boolean(task['action'].get('no_log', False))
)
3 changes: 2 additions & 1 deletion test/TestNoLogPasswordsRule.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# pylint: disable=preferred-module # FIXME: remove once migrated per GH-725
import unittest

from ansiblelint.rules import RulesCollection
from ansiblelint.runner import Runner
from ansiblelint.rules.NoLogPasswordsRule import NoLogPasswordsRule
from ansiblelint.runner import Runner


class TestNoLogPasswordsRule(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/TestRulesCollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ def test_rules_id_format() -> None:
assert rule_id_re.match(
rule.id
), f"R rule id {rule.id} did not match our required format."
assert len(rules) == 39
assert len(rules) == 40

0 comments on commit cdbee00

Please sign in to comment.