ci(ruff)!: update ruff linter config, refactor to comply (#499)

* ci: update ruff linter config

- Set line length to 100
- Enforce Google-style docstrings
- Lint docstrings and imports

* ci(ruff): exclude missing docstring warnings

* ci(ruff): exclude docstring checks from tests dir

* fix(ruff): change top level linter setting

Fix Ruff warning: `warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'per-file-ignores' -> 'lint.per-file-ignores'`.

* chore: format with ruff

* add `.git-blame-ignore-revs`

* ci(ruff): add E402 and F541 checks

* ci(ruff): add FBT003 check (#500)

* ci(ruff): add T20 check

* ci(ruff)!: add N check, refactor method names

* ci(ruff): add E501 check, refactor strings

Much commented-out code is removed in this commit.

* update `.git-blame-ignore.revs`

---------

Co-authored-by: yed <yedpodtrzitko@users.noreply.github.com>
This commit is contained in:
Travis Abendshien
2024-09-13 00:28:00 -07:00
committed by GitHub
parent c15963868e
commit b6e2167605
67 changed files with 727 additions and 1405 deletions

View File

@@ -1,9 +1,36 @@
[tool.ruff]
exclude = ["main_window.py", "home_ui.py", "resources.py", "resources_rc.py"]
line-length = 100
[tool.ruff.lint.per-file-ignores]
"tagstudio/tests/**" = ["D", "E402"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint]
select = ["E", "F", "UP", "B", 'SIM']
ignore = ["E402", "E501", "F541"]
select = [
"B",
"D",
"E",
"F",
"FBT003",
"I",
"N",
"SIM",
"T20",
"UP",
]
ignore = [
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
]
[tool.mypy]
strict_optional = false