Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BEHAVIOR: activate Ruff preview mode #287

Merged
merged 2 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,13 @@ ignore = [
"D416",
"E501",
"PLR0913",
"PLW1514",
"PLW2901",
"S301",
"SIM108",
"UP036",
]
preview = true
show-fixes = true
src = [
"src",
Expand Down Expand Up @@ -312,6 +314,7 @@ known-first-party = ["compwa_policy"]
"PGH001",
"PLR0913",
"PLR2004",
"PLR6301",
"S101",
"T20",
]
Expand Down
6 changes: 3 additions & 3 deletions src/compwa_policy/check_dev_files/github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from ruamel.yaml.main import YAML


def main(
def main( # noqa: PLR0917
allow_deprecated: bool,
doc_apt_packages: list[str],
github_pages: bool,
Expand Down Expand Up @@ -94,7 +94,7 @@ def _update_pr_linting() -> None:
raise PrecommitError(msg)


def _update_ci_workflow(
def _update_ci_workflow( # noqa: PLR0917
allow_deprecated: bool,
doc_apt_packages: list[str],
github_pages: bool,
Expand Down Expand Up @@ -140,7 +140,7 @@ def update() -> None:
executor.finalize()


def _get_ci_workflow(
def _get_ci_workflow( # noqa: PLR0917
path: Path,
doc_apt_packages: list[str],
github_pages: bool,
Expand Down
3 changes: 3 additions & 0 deletions src/compwa_policy/check_dev_files/ruff.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def __update_ruff_settings(has_notebooks: bool) -> None:
"D407", # missing dashed underline after section
"D416", # section name does not have to end with a colon
"E501", # line-width already handled by black
"PLW1514", # allow missing encoding in open()
"SIM108", # allow if-else blocks
]
if "3.6" in get_supported_python_versions():
Expand All @@ -289,6 +290,7 @@ def __update_ruff_settings(has_notebooks: bool) -> None:
minimal_settings = {
"extend-select": __get_selected_ruff_rules(),
"ignore": to_toml_array(ignores),
"preview": True,
"show-fixes": True,
"target-version": __get_target_version(),
"task-tags": __get_task_tags(settings),
Expand Down Expand Up @@ -492,6 +494,7 @@ def _update_ruff_per_file_ignores(has_notebooks: bool) -> None:
"INP001", # allow implicit-namespace-package
"PGH001", # allow eval
"PLR2004", # magic-value-comparison
"PLR6301", # allow non-static method
"S101", # allow assert
"T20", # allow print and pprint
}
Expand Down
Loading