diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 9ce2a1a7d8..e3f8a57a23 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -11,3 +11,4 @@ eaa5e07b2866e05b6c7b5628ca92e9cb1142d008 # Code reformatting 340ff8586d4f1cb6a0f3c934eb42589bcc29c0ea e530d2906a1f61df89861286ac57c951a247f32c +b769b0bc01520d12699d3911e1fc290b813cde40 diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 271147f3f0..4c538eaf2c 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -23,6 +23,12 @@ stable_branches = [ "stable-*" ] code_files = ["."] # consider all Python files in the collection run_isort = false run_black = false +run_ruff_autofix = true +ruff_autofix_config = "ruff.toml" +ruff_autofix_select = [ + "I", + "RUF022", +] run_ruff_check = true ruff_check_config = "ruff.toml" run_ruff_format = true diff --git a/ruff.toml b/ruff.toml index 20956609ec..8ab36056a8 100644 --- a/ruff.toml +++ b/ruff.toml @@ -7,7 +7,7 @@ line-length = 120 [lint] # https://docs.astral.sh/ruff/rules/ -select = ["A", "B", "E", "F", "FA", "FLY", "UP", "SIM"] +select = ["A", "B", "E", "F", "FA", "FLY", "UP", "SIM", "I", "RUF022"] ignore = [ # Better keep ignored (for now) "F811", # Redefinition of unused `xxx` (happens a lot for fixtures in unit tests) @@ -62,3 +62,11 @@ line-ending = "lf" # Disable auto-formatting of code examples in docstrings. Markdown, # reStructuredText code/literal blocks and doctests are all supported. docstring-code-format = false + +[lint.isort] +known-first-party = [ + "ansible_collections.community.general", +] +known-third-party = [ + "ansible_collections.community.internal_test_tools", +]