From 3a1bfc66ba13ef59c4f3ee54ea595b58b8f07375 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 1 Oct 2026 23:19:18 +0200 Subject: [PATCH] chore(deps): bump ruff from 0.15.17 to 0.16.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Supersedes #318, which only moved the lockfile and left the Python 3.13 job red on `ruff check .` (21 errors, the other matrix legs cancelled behind it). Both new findings come from preview rules, which this repo opts into with `preview = true`: - `rule-codes-in-selectors`: ruff 0.16 wants rule names, not codes, in `ignore` and `per-file-ignores`. Converted with `ruff check --fix`; linter prefixes in `select` (and `"D"` in the tests ignore) are not affected. The NOTE comment now names D203/D211 by their current names too. - `property-docstring-starts-with-verb`: a property's docstring describes a value, so the 15 "Return …" / "Yield …" docstrings on properties now read as noun phrases ("The type of SQL statement."). Methods keep their imperative docstrings, as D401 still expects. The dev constraint moves to `>=0.16.8,<0.17.0`, and the lock resolves to 0.16.10, the latest 0.16 release. No other package changed. Co-Authored-By: Claude Opus 5.5 Change-Id: I480194db284d4a67a1155f23add802ded4f9f204 --- poetry.lock | 44 ++++++++++++++++++++--------------------- pyproject.toml | 18 ++++++++--------- sql_compare/__init__.py | 30 ++++++++++++++-------------- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/poetry.lock b/poetry.lock index 56e51e4..8b87291 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.5.1 and should not be changed by hand. [[package]] name = "ast-serialize" @@ -89,7 +89,7 @@ description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" groups = ["dev"] -markers = "platform_system == \"Windows\" or sys_platform == \"win32\"" +markers = "sys_platform == \"win32\" or platform_system == \"Windows\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -613,30 +613,30 @@ types-setuptools = ">=69.1.0" [[package]] name = "ruff" -version = "0.15.17" +version = "0.16.10" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "ruff-0.15.17-py3-none-linux_armv6l.whl", hash = "sha256:d9feddb927fc68bd295f5eebc587a7e42cfaf9b65f60ca4a2386febff575da8f"}, - {file = "ruff-0.15.17-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:25805a226d741c47d274a35ad5c10a7dde175fcddfa511d7cf3da0a21eb3eab7"}, - {file = "ruff-0.15.17-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f6ad73b14c2d18a3bf8ad7cb6974294d7f613a7898604826058e6ac64918ef4d"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ba0c1e4f95bcb3869d0d30cbd5917071ef2e28665abfec970cdab0492c713ed"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:81647960f10bff57d2e51cadd0c3950fe598400c852863a038720ef5b8cca91e"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0e01a84ddbc8c16c23055ba3924476850f1bbc1917cebbb9376665a63e74260d"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84fe9f653152f8f294f9f7e03bf3a453d8b4a27f7a59c78c8666167f2b17b96c"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8c0fe88a7676e7a05b73174d4d4a59cb2ac21ff8263583f87a81a6018475a978"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecfc3c7878fff94633ab0348524e093f9ce3243080416dd7d14f8ba400174719"}, - {file = "ruff-0.15.17-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:b8461180b22420b1bdc289909410930761629fddf2a5aaf60fae1ab26cedc4c4"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6eccbe50a038b503e7140b441aa9c7fc8c1f36edf23ebef9f4165c2f28f568b7"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:382fc0521025f5a8ad447d8bdd523545d0d7646adb718eb1c2dac5065ec27c0f"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_i686.whl", hash = "sha256:456d41fcd1b2777ad63f09a6e7121d43f7b688bbc76a800c10f7f8fb1f912c3f"}, - {file = "ruff-0.15.17-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b1a04bcc94ae6194e9db05d16ad31f298a7194bfbcb08258bbe589cee1d587b8"}, - {file = "ruff-0.15.17-py3-none-win32.whl", hash = "sha256:596065960ab1ff593f744220c9fe6580eda00a95003cffa9f4048bb5b1bf0392"}, - {file = "ruff-0.15.17-py3-none-win_amd64.whl", hash = "sha256:6769e5fa1710b179b92e0bfa5a51735b35baea9013dadb06d5f44cbcf9547084"}, - {file = "ruff-0.15.17-py3-none-win_arm64.whl", hash = "sha256:f3be1fbb34bcdfd146240d8fb92a709d4c2c8191348580a3c044ec60fa0b4456"}, - {file = "ruff-0.15.17.tar.gz", hash = "sha256:2ec446937fd16c8c4de2674a209cc5af64d9c6f17d21fbf1151054fa0bcf5219"}, + {file = "ruff-0.16.10-py3-none-linux_armv6l.whl", hash = "sha256:488b0fe3f3574210e5cf80d9f59b9e3ab17a127a8155de3f307b392589cfb511"}, + {file = "ruff-0.16.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e748ff95c934c4e978783b8e687bc174e7bd84e8ad24e3243e1ecfcda5e0282d"}, + {file = "ruff-0.16.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3031a4a2e8e7b8a46f70be45f198c35a11ece509a94b80334d8d397a33c67550"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:494401c86df4c4c25f69b9419605d944467ee98c42fb6ad405ef4fa40b8fb67d"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d203abc0ff2b773ee33d00ab8df0bb67046fbc7c07b119332f08b9b345cf8221"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd83d1235a5258d318477bc5b576303974cbdef5df0c01a1bff14efcc23bd12a"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc2610fb269fa56dd8a68669ae470fa6272902668c0fc2ebc3aa112b2633d5b8"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3e70175e29cc94c26ea296c80e470180b744b7419026898e58f520c6ab32578e"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f33f43a864a8483eebd160e713336c8bab02c934feaff0a33cf5ccb41546d09a"}, + {file = "ruff-0.16.10-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:1dfc6f0088149fb6a362c1c446bcbb3fd2157b3852fe2fa68409276eab9ad9b3"}, + {file = "ruff-0.16.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6553498afc35f580f036030795810b9e6bcea31604b0fd9e8d352795473042e3"}, + {file = "ruff-0.16.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a3b8471dea115d37f123882be852bed13403746d3a76c11de4a19ec5f9ff5a03"}, + {file = "ruff-0.16.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:92e59a70bcbd9d3a5483656da906ec28edfdacfce00afd99edb8b4e9d15644be"}, + {file = "ruff-0.16.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:7ae7375f803b5520dc9f546bed7e3a0acb70b91812e9bb4b19927de22f25b77d"}, + {file = "ruff-0.16.10-py3-none-win32.whl", hash = "sha256:2a12e01cb9156c10c466f63b46eaae5ecea28dfbd21b5836353ae498e7d1349a"}, + {file = "ruff-0.16.10-py3-none-win_amd64.whl", hash = "sha256:97f2015c92aa97105b0eab19eb5d224884399281cfc5da86a92db4ab5e7fb2ca"}, + {file = "ruff-0.16.10-py3-none-win_arm64.whl", hash = "sha256:25a65fe998c4e6861ec079ada5826a2fc605e6cbccbe9dcd7fac1f54e791621b"}, + {file = "ruff-0.16.10.tar.gz", hash = "sha256:eff4728c4eaae93f0955cd264d24b2ab348e74bf59986ccf282ba6dc16b3b017"}, ] [[package]] @@ -695,4 +695,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "31b414218726302b08555065200f8d885646231d34bdf70fc53d9ae491e56fc4" +content-hash = "2523504fce904d842aa579b48d9983126f556d2d033661a08fb5c6e8efb9169d" diff --git a/pyproject.toml b/pyproject.toml index 513a9ef..74a1c06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ python = "^3.10" sqlparse = ">=0.6.0" [tool.poetry.group.dev.dependencies] -ruff = ">=0.15.17,<0.16.0" +ruff = ">=0.16.8,<0.17.0" mypy = "^2.3.1" pytest = "^9.1.1" poethepoet = ">=0.48.0,<0.49.0" @@ -131,21 +131,21 @@ select = [ ] ignore = [ # NOTE(charly): line-length is up to the formatter - "E501", - # NOTE(charly): `one-blank-line-before-class` (D203) and - # `no-blank-line-before-class` (D211) are incompatible - "D203", + "line-too-long", + # NOTE(charly): `incorrect-blank-line-before-class` (D203) and + # `blank-line-before-class` (D211) are incompatible + "incorrect-blank-line-before-class", # NOTE(charly): `multi-line-summary-first-line` (D212) and # `multi-line-summary-second-line` (D213) are incompatible - "D213", + "multi-line-summary-second-line", # Single-module library, __init__.py is the main module - "RUF067", + "non-empty-init-module", # SQL files are always UTF-8 - "PLW1514", + "unspecified-encoding", ] [tool.ruff.lint.per-file-ignores] -"tests/**/*.py" = ["S101", "D"] +"tests/**/*.py" = ["assert", "D"] [tool.ruff.lint.isort] force-single-line = true diff --git a/sql_compare/__init__.py b/sql_compare/__init__.py index 2020b91..835d3ca 100644 --- a/sql_compare/__init__.py +++ b/sql_compare/__init__.py @@ -92,22 +92,22 @@ def __repr__(self) -> str: @property def hash(self) -> str: - """Return the normalized token value.""" + """The normalized token value.""" return str(self.token.normalized) @property def ignore(self) -> bool: - """Return whether the token should be ignored.""" + """Whether the token should be ignored.""" return self.token.is_whitespace or self.is_comment @property def is_comment(self) -> bool: - """Return whether the token is a comment.""" + """Whether the token is a comment.""" return isinstance(self.token, sqlparse.sql.Comment) @property def is_separator(self) -> bool: - """Return whether the token is a separator.""" + """Whether the token is a separator.""" return bool( self.token.ttype == sqlparse.tokens.Punctuation and self.token.normalized == ",", @@ -115,7 +115,7 @@ def is_separator(self) -> bool: @property def str_tokens(self) -> list[str]: - """Return the token value.""" + """The token value, or nothing if it is blank.""" if self.hash.strip(): return [self.hash] return [] @@ -141,22 +141,22 @@ def __hash__(self) -> int: @property def hash(self) -> str: - """Return the hash of the `TokenList` instance.""" + """The hash of the `TokenList` instance.""" return "".join(t.hash for t in self.tokens if not t.ignore) @property def ignore(self) -> bool: - """Return whether the token list should be ignored.""" + """Whether the token list should be ignored.""" return self.is_comment @property def is_comment(self) -> bool: - """Return whether the token list is a comment.""" + """Whether the token list is a comment.""" return isinstance(self.token_list, sqlparse.sql.Comment) @property def tokens(self) -> Generator[Token | TokenList, None, None]: - """Yield relevant tokens in a deterministic order.""" + """Relevant tokens, in a deterministic order.""" for token in self.token_list.tokens: if token.is_group: if UnorderedTokenList.is_unordered(token, self.statement_type): @@ -168,7 +168,7 @@ def tokens(self) -> Generator[Token | TokenList, None, None]: @property def statement_type(self) -> str: - """Return the type of SQL statement.""" + """The type of SQL statement.""" if self.parent: return self.parent.statement_type @@ -176,7 +176,7 @@ def statement_type(self) -> str: @property def str_tokens(self) -> list[str]: - """Return the reconstructed SQL statement from tokens as a list of strings.""" + """The reconstructed SQL statement from tokens, as a list of strings.""" return [t.hash for t in self.tokens if not t.ignore] @@ -212,7 +212,7 @@ class Statement(TokenList): @property def statement_type(self) -> str: - """Return the type of SQL statement.""" + """The type of SQL statement.""" keywords: list[str] = [ t.normalized for t in self.token_list.tokens @@ -252,7 +252,7 @@ def _leading_unlexed_verb(self) -> list[str]: @property def str_tokens(self) -> list[str]: - """Return the reconstructed SQL statement from tokens as a list of strings.""" + """The reconstructed SQL statement from tokens, as a list of strings.""" return [t for token in self.tokens for t in token.str_tokens] @@ -271,7 +271,7 @@ def is_unordered(token_list: sqlparse.sql.TokenList, statement_type: str) -> boo @property def tokens(self) -> Generator[Token | TokenList, None, None]: - """Yield relevant tokens in a deterministic order.""" + """Relevant tokens, in a deterministic order.""" filtered_tokens = [t for t in self.flatten_tokens if not t.ignore] # Split punctuations and identifiers (columns, types, etc.) @@ -289,7 +289,7 @@ def tokens(self) -> Generator[Token | TokenList, None, None]: @property def flatten_tokens(self) -> Generator[Token, None, None]: - """Yield all tokens in the token tree.""" + """All tokens in the token tree.""" yield from (Token(t) for t in self.token_list.flatten()) # type: ignore[no-untyped-call] @staticmethod