From 1336f384961b4aa11e50b5d4740183cb012c9dd1 Mon Sep 17 00:00:00 2001 From: TensorTemplar Date: Sat, 21 Mar 2026 08:58:30 +0100 Subject: [PATCH] Properly supress syntax warnings for repos where people do not know how to write python in --- pyproject.toml | 2 +- src/slopometry/cli.py | 4 ++++ src/slopometry/summoner/services/current_impact_service.py | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d5e5cd2..f97e826 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "slopometry" -version = "2026.3.20" +version = "2026.3.21" description = "Opinionated code quality metrics for code agents and humans" readme = "README.md" requires-python = ">=3.13" diff --git a/src/slopometry/cli.py b/src/slopometry/cli.py index 23cc983..1dfa04b 100644 --- a/src/slopometry/cli.py +++ b/src/slopometry/cli.py @@ -2,8 +2,12 @@ import shutil import sys +import warnings from importlib.metadata import version +# REASON: analyzed repos may contain invalid escape sequences that emit SyntaxWarnings during AST parsing +warnings.filterwarnings("ignore", category=SyntaxWarning) + import click from slopometry.display.console import console diff --git a/src/slopometry/summoner/services/current_impact_service.py b/src/slopometry/summoner/services/current_impact_service.py index 665c84a..e615ae4 100644 --- a/src/slopometry/summoner/services/current_impact_service.py +++ b/src/slopometry/summoner/services/current_impact_service.py @@ -14,8 +14,8 @@ from slopometry.core.complexity_analyzer import ComplexityAnalyzer from slopometry.core.context_coverage_analyzer import ContextCoverageAnalyzer -from slopometry.core.git_tracker import GitOperationError from slopometry.core.database import EventDatabase +from slopometry.core.git_tracker import GitOperationError from slopometry.core.models.baseline import CurrentChangesAnalysis, GalenMetrics, QPEScore, RepoBaseline, SmellAdvantage from slopometry.core.models.complexity import ComplexityDelta, ExtendedComplexityMetrics from slopometry.core.models.hook import AnalysisSource @@ -128,7 +128,6 @@ def get_token_count(path_str: str) -> int: smell_advantages=smell_advantages, ) - # Maximum number of commits to walk back when searching for code changes MAX_COMMIT_WALKBACK = 10 def analyze_previous_commit(