Skip to content

Commit

Permalink
add ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
mmacata committed Dec 4, 2024
1 parent b6130af commit 334a6a0
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
lint:
uses: mmacata/github-workflows/.github/workflows/linting.yml@post-pr
uses: mmacata/github-workflows/.github/workflows/linting.yml@ruff-config
with:
# set pylint-version to empty string to skip the pylint workflow
pylint-version: ''
Expand Down
188 changes: 188 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# Extends https://github.com/mundialis/github-workflows/blob/main/linting-config-examples/ruff.toml

lint.ignore = [
# See https://docs.astral.sh/ruff/rules/
# TODO: fix lint issues or use lint_per-file-ignores
"A001",
"A002",
"A004",
"ANN001",
"ANN002",
"ANN003",
"ANN201",
"ANN202",
"ANN204",
"ANN205",
"ANN206",
"ARG001",
"ARG002",
"B006",
"B007",
"B018",
"B904",
"BLE001",
"COM812",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"D200",
"D202",
"D205",
"D208",
"D209",
"D212",
"D213",
"D214",
"D301",
"D400",
"D401",
"D402",
"D403",
"D404",
"D411",
"D412",
"D413",
"D414",
"D415",
"D417",
"D419",
"DTZ003",
"DTZ005",
"E501",
"FBT002",
"FBT003",
"FURB101",
"FURB103",
"FURB113",
"FURB118",
"FURB154",
"FURB171",
"G002",
"G003",
"G004",
"I001",
"ICN001",
"ISC001",
"ISC003",
"N802",
"N806",
"N814",
"N818",
"PERF102",
"PERF203",
"PERF401",
"PIE790",
"PLC0206",
"PLC0415",
"PLC1901",
"PLR0904",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0914",
"PLR0915",
"PLR0917",
"PLR1702",
"PLR1704",
"PLR1711",
"PLR1714",
"PLR1722",
"PLR1730",
"PLR2004",
"PLR5501",
"PLR6104",
"PLR6201",
"PLR6301",
"PLW0127",
"PLW0133",
"PLW0602",
"PLW0603",
"PLW1510",
"PLW1514",
"PLW2901",
"PT006",
"PT009",
"PT027",
"PTH100",
"PTH101",
"PTH102",
"PTH103",
"PTH104",
"PTH105",
"PTH107",
"PTH109",
"PTH110",
"PTH112",
"PTH113",
"PTH118",
"PTH119",
"PTH120",
"PTH122",
"PTH123",
"PTH202",
"RET503",
"RET504",
"RET505",
"RET506",
"RET508",
"RUF010",
"RUF012",
"RUF015",
"RUF019",
"S101",
"S102",
"S104",
"S105",
"S106",
"S107",
"S108",
"S110",
"S113",
"S301",
"S307",
"S310",
"S311",
"S314",
"S403",
"S404",
"S405",
"S603",
"S605",
"S606",
"S607",
"S608",
"SIM102",
"SIM103",
"SIM105",
"SIM108",
"SIM113",
"SIM114",
"SIM115",
"SIM118",
"SIM300",
"SIM401",
"SLF001",
"TID252",
"TRY002",
"TRY003",
"TRY201",
"TRY203",
"TRY300",
"TRY301",
"TRY400",
"UP004",
"UP008",
"UP009",
"UP015",
"UP024",
"UP031",
"UP032",
]

# [lint.per-file-ignores]
# Define file-specific linting rule ignores
# "lib_dop/r_dop_import_lib.py" = ["ERA001", "PLR2004"]
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ def _check_reset_region(self):
if self.skip_region_check is True:
return

errorid, stdout_buff, dummy = self.ginit.run_module("g.region", ["-ug"])
errorid, stdout_buff, _ = self.ginit.run_module("g.region", ["-ug"])

if errorid != 0:
raise AsyncProcessError(
Expand Down

0 comments on commit 334a6a0

Please sign in to comment.