From dfcec1024900dce8c8fc52d4896cfdd510be2cb8 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Sat, 22 Aug 2026 11:25:13 -0700 Subject: [PATCH] Update linting settings --- .ruff.toml | 30 +++++++++++++++--------------- prek.toml | 31 ++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 501e1cd..fe23cc4 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -45,21 +45,21 @@ extend-select = [ "TRY", ] extend-ignore = [ - "COM812", - "D203", - "D213", - "D400", - "D413", - "DOC501", - "E266", - "EM101", - "PLC1901", - "RET504", - "SIM102", - "SIM108", - "TRY002", - "TRY003", - "TRY300", + "missing-trailing-comma", + "incorrect-blank-line-before-class", + "multi-line-summary-second-line", + "missing-trailing-period", + "missing-blank-line-after-last-section", + "docstring-missing-exception", + "multiple-leading-hashes-for-block-comment", + "raw-string-in-exception", + "compare-to-empty-string", + "unnecessary-assign", + "collapsible-if", + "if-else-block-instead-of-if-exp", + "raise-vanilla-class", + "raise-vanilla-args", + "try-consider-else", ] [lint.pycodestyle] diff --git a/prek.toml b/prek.toml index 3ef5beb..43154d7 100644 --- a/prek.toml +++ b/prek.toml @@ -122,7 +122,7 @@ hooks = [ ] } }, ] -## Java +## Java and Kotlin # https://github.com/ORCID/pre-commit-spotless requires use of a spotless.xml file. @@ -131,7 +131,8 @@ repo = "local" hooks = [ { id = "gradle-spotless", name = "spotless formatting", language = "unsupported", entry = "bash -c 'if [ -f ./gradlew ] ; then ./gradlew spotlessApply; fi'", files = { glob = [ "**/*.java", - "**/*.gradle.kts", + "**/*.kt", + "**/*.kts", ] }, pass_filenames = false }, ] @@ -312,15 +313,23 @@ hooks = [ ## TOML -[[repos]] -repo = "https://github.com/ComPWA/taplo-pre-commit" -rev = "v0.9.3" -hooks = [ - { id = "taplo-format" }, - ## Issues error: - ## WARN taplo: failed to fetch catalog error=error decoding response body: data did not match any variant of untagged enum SchemaCatalog - # { id = "taplo-lint" } -] +# This doesn't affect .toml files. Maybe some different configuration is needed. +# [[repos]] +# repo = "https://github.com/oxc-project/mirrors-oxlint" +# rev = "v1.79.0" +# hooks = [ +# { id = "oxlint", verbose = true } +# ] + +# Taplo does not work on ARM and is not actively maintained. +# repo = "https://github.com/ComPWA/taplo-pre-commit" +# rev = "v0.9.3" +# hooks = [ +# { id = "taplo-format" }, +# ## Issues error: +# ## WARN taplo: failed to fetch catalog error=error decoding response body: data did not match any variant of untagged enum SchemaCatalog +# # { id = "taplo-lint" } +# ] ## YAML