From ec6478b8d6f1b9250213a31d40b07ba73d86c79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Fri, 26 Dec 2025 15:25:38 +0300 Subject: [PATCH 1/3] Bump ruff-pre-commit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ec62a8f37..09cf9c48cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.13.2 + rev: v0.14.10 hooks: - id: ruff-check args: [--fix] From 8fde2138876af9c4db76cb70f823907e95cb03c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Fri, 26 Dec 2025 15:30:46 +0300 Subject: [PATCH 2/3] Try to centralize include setting for ruff --- .pre-commit-config.yaml | 5 +++++ pyproject.toml | 3 +++ tox.ini | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 09cf9c48cb..f8fb5174fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,14 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: + # ruff-pre-commit is not using tool.ruff.include setting, + # so `files` need to be specified here. + # https://github.com/astral-sh/ruff-pre-commit/issues/71 - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.10 hooks: - id: ruff-check args: [--fix] + files: ^(sentry_sdk/|tests/) - id: ruff-format + files: ^(sentry_sdk/|tests/) diff --git a/pyproject.toml b/pyproject.toml index 2038ccd81f..4598f0f1fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -196,6 +196,9 @@ ignore_missing_imports = true # Target Python 3.7+ (minimum version supported by ruff) target-version = "py37" +# Include files and directories +include = ["sentry_sdk/**/*.py", "tests/**/*.py"] + # Exclude files and directories extend-exclude = [ "*_pb2.py", # Protocol Buffer files (covers all pb2 files including grpc_test_service_pb2.py) diff --git a/tox.ini b/tox.ini index 26166555c1..f756750c1c 100644 --- a/tox.ini +++ b/tox.ini @@ -925,6 +925,6 @@ commands = [testenv:linters] commands = - ruff check tests sentry_sdk - ruff format --check tests sentry_sdk + ruff check + ruff format --check mypy sentry_sdk From 6037f2a9b8fc4d82e63a7312d9c89d86dac500fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Fri, 26 Dec 2025 15:32:34 +0300 Subject: [PATCH 3/3] Make use of existing pre-commit setup in tox testenv:linters --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index f756750c1c..7dfe54c758 100644 --- a/tox.ini +++ b/tox.ini @@ -925,6 +925,5 @@ commands = [testenv:linters] commands = - ruff check - ruff format --check + pre-commit run --all-files mypy sentry_sdk