From: Frazer McLean Date: Thu, 26 Jun 2025 18:49:53 +0000 (+0200) Subject: Update ruff examples to use the module hook X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1d603c4030be4868a1a82dd8f8fb2e4a716c987;p=thirdparty%2Fsqlalchemy%2Falembic.git Update ruff examples to use the module hook --- diff --git a/alembic/templates/async/alembic.ini.mako b/alembic/templates/async/alembic.ini.mako index 782524e2..67acc6d0 100644 --- a/alembic/templates/async/alembic.ini.mako +++ b/alembic/templates/async/alembic.ini.mako @@ -98,10 +98,16 @@ sqlalchemy.url = driver://user:pass@localhost/dbname # black.entrypoint = black # black.options = -l 79 REVISION_SCRIPT_FILENAME -# lint with attempts to fix using "ruff" - use the exec runner, execute a binary +# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module +# hooks = ruff +# ruff.type = module +# ruff.module = ruff +# ruff.options = check --fix REVISION_SCRIPT_FILENAME + +# Alternatively, use the exec runner to execute a binary found on your PATH # hooks = ruff # ruff.type = exec -# ruff.executable = %(here)s/.venv/bin/ruff +# ruff.executable = ruff # ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration. This is also consumed by the user-maintained diff --git a/alembic/templates/generic/alembic.ini.mako b/alembic/templates/generic/alembic.ini.mako index cb4e2bf3..bb93d0e3 100644 --- a/alembic/templates/generic/alembic.ini.mako +++ b/alembic/templates/generic/alembic.ini.mako @@ -98,10 +98,16 @@ sqlalchemy.url = driver://user:pass@localhost/dbname # black.entrypoint = black # black.options = -l 79 REVISION_SCRIPT_FILENAME -# lint with attempts to fix using "ruff" - use the exec runner, execute a binary +# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module +# hooks = ruff +# ruff.type = module +# ruff.module = ruff +# ruff.options = check --fix REVISION_SCRIPT_FILENAME + +# Alternatively, use the exec runner to execute a binary found on your PATH # hooks = ruff # ruff.type = exec -# ruff.executable = %(here)s/.venv/bin/ruff +# ruff.executable = ruff # ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration. This is also consumed by the user-maintained diff --git a/alembic/templates/multidb/alembic.ini.mako b/alembic/templates/multidb/alembic.ini.mako index 2680ef68..a6629839 100644 --- a/alembic/templates/multidb/alembic.ini.mako +++ b/alembic/templates/multidb/alembic.ini.mako @@ -106,10 +106,16 @@ sqlalchemy.url = driver://user:pass@localhost/dbname2 # black.entrypoint = black # black.options = -l 79 REVISION_SCRIPT_FILENAME -# lint with attempts to fix using "ruff" - use the exec runner, execute a binary +# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module +# hooks = ruff +# ruff.type = module +# ruff.module = ruff +# ruff.options = check --fix REVISION_SCRIPT_FILENAME + +# Alternatively, use the exec runner to execute a binary found on your PATH # hooks = ruff # ruff.type = exec -# ruff.executable = %(here)s/.venv/bin/ruff +# ruff.executable = ruff # ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration. This is also consumed by the user-maintained diff --git a/docs/build/tutorial.rst b/docs/build/tutorial.rst index 7354c82f..eccf8f30 100644 --- a/docs/build/tutorial.rst +++ b/docs/build/tutorial.rst @@ -248,10 +248,16 @@ The all-in-one .ini file created by ``generic`` is illustrated below:: # black.entrypoint = black # black.options = -l 79 REVISION_SCRIPT_FILENAME - # lint with attempts to fix using "ruff" - use the exec runner, execute a binary + # lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module + # hooks = ruff + # ruff.type = module + # ruff.module = ruff + # ruff.options = check --fix REVISION_SCRIPT_FILENAME + + # Alternatively, use the exec runner to execute a binary found on your PATH # hooks = ruff # ruff.type = exec - # ruff.executable = %(here)s/.venv/bin/ruff + # ruff.executable = ruff # ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration. This is also consumed by the user-maintained