From: Rishat Fayzullin Date: Tue, 4 Mar 2025 20:32:44 +0000 (-0500) Subject: Fix linting with ruff provided in alembic.ini by scratch X-Git-Tag: rel_1_15_1~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b63cc2cb70a4f01ea43e38b39f300c024a09a31;p=thirdparty%2Fsqlalchemy%2Falembic.git Fix linting with ruff provided in alembic.ini by scratch Fixes: #1614 Closes: #1615 Pull-request: https://github.com/sqlalchemy/alembic/pull/1615 Pull-request-sha: 92342fac19adf62a148ab937d1dc82417adb6e17 Change-Id: I02f801007a877e8498fab6dd3159b65bb2412c01 --- diff --git a/alembic/templates/async/alembic.ini.mako b/alembic/templates/async/alembic.ini.mako index f97e2d66..7ffd7926 100644 --- a/alembic/templates/async/alembic.ini.mako +++ b/alembic/templates/async/alembic.ini.mako @@ -79,7 +79,7 @@ sqlalchemy.url = driver://user:pass@localhost/dbname # hooks = ruff # ruff.type = exec # ruff.executable = %(here)s/.venv/bin/ruff -# ruff.options = --fix REVISION_SCRIPT_FILENAME +# ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration [loggers] diff --git a/alembic/templates/generic/alembic.ini.mako b/alembic/templates/generic/alembic.ini.mako index 4fc5d01a..3e211d0d 100644 --- a/alembic/templates/generic/alembic.ini.mako +++ b/alembic/templates/generic/alembic.ini.mako @@ -81,7 +81,7 @@ sqlalchemy.url = driver://user:pass@localhost/dbname # hooks = ruff # ruff.type = exec # ruff.executable = %(here)s/.venv/bin/ruff -# ruff.options = --fix REVISION_SCRIPT_FILENAME +# ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration [loggers] diff --git a/alembic/templates/multidb/alembic.ini.mako b/alembic/templates/multidb/alembic.ini.mako index 116bd4a8..00316456 100644 --- a/alembic/templates/multidb/alembic.ini.mako +++ b/alembic/templates/multidb/alembic.ini.mako @@ -86,7 +86,7 @@ sqlalchemy.url = driver://user:pass@localhost/dbname2 # hooks = ruff # ruff.type = exec # ruff.executable = %(here)s/.venv/bin/ruff -# ruff.options = --fix REVISION_SCRIPT_FILENAME +# ruff.options = check --fix REVISION_SCRIPT_FILENAME # Logging configuration [loggers] diff --git a/tests/test_post_write.py b/tests/test_post_write.py index f728f0bb..9f019ca3 100644 --- a/tests/test_post_write.py +++ b/tests/test_post_write.py @@ -307,11 +307,11 @@ black.cwd = /path/to/cwd hooks = ruff ruff.type = exec ruff.executable = ruff -ruff.options = --fix +ruff.options = check --fix """ def expected_additional_arguments_fn(rev_path): - return [rev_path, "--fix"] + return [rev_path, "check", "--fix"] self._run_ruff_with_config( input_config, expected_additional_arguments_fn @@ -323,11 +323,11 @@ ruff.options = --fix hooks = ruff ruff.type = exec ruff.executable = %(here)s/.venv/bin/ruff -ruff.options = --fix +ruff.options = check --fix """ def expected_additional_arguments_fn(rev_path): - return [rev_path, "--fix"] + return [rev_path, "check", "--fix"] self._run_ruff_with_config( input_config,