django-nh3 icon indicating copy to clipboard operation
django-nh3 copied to clipboard

Conflicting pre-commit hooks

Open blag opened this issue 7 months ago • 1 comments

The Ruff hook complains about:

ruff.....................................................................Failed
- hook id: ruff
- exit code: 1
- files were modified by this hook

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`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'isort' -> 'lint.isort'
  - 'pyupgrade' -> 'lint.pyupgrade'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

but when you fix that, the pyproject-fmt hook complains:

pyproject-fmt............................................................Failed
- hook id: pyproject-fmt
- exit code: 1
- files were modified by this hook

--- pyproject.toml

+++ pyproject.toml

@@ -63,37 +63,6 @@

   ".ruff_cache",
 ]

-[lint]
-# https://beta.ruff.rs/docs/configuration/
-select = [
-  "E",   # pycodestyle errors
-  "W",   # pycodestyle warnings
-  "F",   # pyflakes
-  "I",   # isort
-  "C",   # flake8-comprehensions
-  "B",   # flake8-bugbear
-  "Q",   # flake8-quotes
-  "PLE", # pylint error
-  "PLR", # pylint refactor
-  "PLW", # pylint warning
-  "UP",  # pyupgrade
-]
-
-ignore = [
-  "B006",    # Do not use mutable data structures for argument defaults
-  "PLR0913", # Too many arguments to function call,
-]
-
-isort.combine-as-imports = true
-# Preserve types, even if a file imports `from __future__ import annotations`.
-pyupgrade.keep-runtime-typing = true
-per-file-ignores."__init__.py" = [
-  "F401", # unused-import
-]
-per-file-ignores."src/django_nh3/forms.py" = [
-  "UP035", # import-replacements - breaks type hint Callable
-]
-
 [tool.pytest]
 DJANGO_SETTINGS_MODULE = "tests.settings"
 django_find_project = false
@@ -139,6 +108,37 @@

 module = "tests.*"
 allow_untyped_defs = true

+[lint]
+# https://beta.ruff.rs/docs/configuration/
+select = [
+  "E",   # pycodestyle errors
+  "W",   # pycodestyle warnings
+  "F",   # pyflakes
+  "I",   # isort
+  "C",   # flake8-comprehensions
+  "B",   # flake8-bugbear
+  "Q",   # flake8-quotes
+  "PLE", # pylint error
+  "PLR", # pylint refactor
+  "PLW", # pylint warning
+  "UP",  # pyupgrade
+]
+
+ignore = [
+  "B006",    # Do not use mutable data structures for argument defaults
+  "PLR0913", # Too many arguments to function call,
+]
+
+isort.combine-as-imports = true
+# Preserve types, even if a file imports `from __future__ import annotations`.
+pyupgrade.keep-runtime-typing = true
+per-file-ignores."__init__.py" = [
+  "F401", # unused-import
+]
+per-file-ignores."src/django_nh3/forms.py" = [
+  "UP035", # import-replacements - breaks type hint Callable
+]
+
 [tool.rstcheck]
 ignore_directives = [
   "automodule",

I'm not really sure how to fix that to the point that all pre-commit hooks are satisfied.

blag avatar May 19 '25 23:05 blag

I didnt' have an issue running ruff or all hooks. I've also updated hooks this morning so this might not be an issue.

marksweb avatar May 23 '25 13:05 marksweb