Skip to content

Commit

Permalink
Enable and fix PT checks on ruff (#3278)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Apr 13, 2023
1 parent e221dd7 commit e197112
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ per-file-ignores =
test/*: D102

# flake8-pytest-style
# PT001:
pytest-fixture-no-parentheses = true
# PT006:
pytest-parametrize-names-type = tuple
# PT007:
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,16 @@ xfail_strict = true
markers = ["eco: Tests effects on a set of 3rd party ansible repositories"]

[tool.ruff]
# select = ["ALL"]
select = ["PT"]
ignore = [
"E501", # we use black

]
target-version = "py39"

[tool.ruff.flake8-pytest-style]
parametrize-values-type = "tuple"

[tool.setuptools.dynamic]
optional-dependencies.docs = { file = [".config/requirements-docs.txt"] }
optional-dependencies.test = { file = [".config/requirements-test.txt"] }
Expand Down
4 changes: 2 additions & 2 deletions src/ansiblelint/testing/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def fixture_default_rules_collection() -> RulesCollection:
return RulesCollection(rulesdirs=[DEFAULT_RULESDIR], options=options)


@pytest.fixture
@pytest.fixture()
def default_text_runner(default_rules_collection: RulesCollection) -> RunFromText:
"""Return RunFromText instance for the default set of collections."""
return RunFromText(default_rules_collection)


@pytest.fixture
@pytest.fixture()
def rule_runner(request: SubRequest, config_options: Namespace) -> RunFromText:
"""Return runner for a specific rule class."""
rule_class = request.param
Expand Down

0 comments on commit e197112

Please sign in to comment.