diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cfc44fd..271b62f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,3 +35,6 @@ jobs: - name: MyPy omniray run: uv run --directory packages/omniray mypy omniray/ + + - name: Shamefile check + run: uv run shame me . --dry-run diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e24e7df..8839dab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,3 +24,8 @@ repos: additional_dependencies: [wrapt, pydantic, opentelemetry-api, opentelemetry-sdk] files: ^packages/ exclude: tests/ + + - repo: https://github.com/BKDDFS/shamefile + rev: v0.1.7 + hooks: + - id: shamefile diff --git a/README.md b/README.md index 545c411..ca886bb 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ [![Python](https://img.shields.io/pypi/pyversions/omniray)](https://pypi.org/project/omniray/) [![Docs](https://img.shields.io/badge/docs-blue)](https://omniviser.github.io/omniray/) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![shamefile](https://img.shields.io/badge/tracked_with-shamefile-fe3434)](https://github.com/BKDDFS/shamefile) **One call, and you see everything that's happening in your code.** diff --git a/packages/omniray/omniray/tracing/compactor.py b/packages/omniray/omniray/tracing/compactor.py index 63fa7ca..fb658c1 100644 --- a/packages/omniray/omniray/tracing/compactor.py +++ b/packages/omniray/omniray/tracing/compactor.py @@ -224,7 +224,7 @@ def _emit_summary(self, streak: _Streak) -> None: logger.info( "%s%s %s", profilers.get_indent(streak.depth, is_start=False), - profilers._colored(Fore.RED + Style.BRIGHT, f"x{streak.count}"), # noqa: SLF001 + profilers.colored(Fore.RED + Style.BRIGHT, f"x{streak.count}"), streak.span_name, ) cont = _continuation_indent(streak.depth) @@ -268,26 +268,23 @@ def _format_time_line(streak: _Streak, avg_ms: float, thresholds: Thresholds) -> def _color_ms(value_ms: float, thresholds: Thresholds) -> str: - color = profilers._bucket_color(value_ms, thresholds.duration_ms) # noqa: SLF001 - return profilers._colored(color, f"{value_ms:.2f}ms") # noqa: SLF001 + color = profilers.bucket_color(value_ms, thresholds.duration_ms) + return profilers.colored(color, f"{value_ms:.2f}ms") def _format_memory_line(streak: _Streak, thresholds: Thresholds) -> str: """Build the ``memory:`` continuation line, omitting unset fields.""" parts: list[str] = [] if streak.total_input_mb is not None: - parts.append("Σin: " + profilers._format_mb(streak.total_input_mb, thresholds.size_mb)) # noqa: SLF001 + parts.append("Σin: " + profilers.format_mb(streak.total_input_mb, thresholds.size_mb)) if streak.total_output_mb is not None: - parts.append("Σout: " + profilers._format_mb(streak.total_output_mb, thresholds.size_mb)) # noqa: SLF001 + parts.append("Σout: " + profilers.format_mb(streak.total_output_mb, thresholds.size_mb)) if streak.max_rss_mb is not None: - parts.append("rss: " + profilers._format_mb(streak.max_rss_mb, thresholds.rss_mb)) # noqa: SLF001 + parts.append("rss: " + profilers.format_mb(streak.max_rss_mb, thresholds.rss_mb)) if streak.total_rss_delta_mb is not None: parts.append( - "Σ" - + profilers._format_mb( # noqa: SLF001 - streak.total_rss_delta_mb, thresholds.rss_delta_mb, sign=True - ) + "Σ" + profilers.format_mb(streak.total_rss_delta_mb, thresholds.rss_delta_mb, sign=True) ) if streak.max_rss_peak_mb is not None: - parts.append("peak: " + profilers._format_mb(streak.max_rss_peak_mb, thresholds.rss_mb)) # noqa: SLF001 + parts.append("peak: " + profilers.format_mb(streak.max_rss_peak_mb, thresholds.rss_mb)) return ", ".join(parts) diff --git a/packages/omniray/omniray/tracing/otel.py b/packages/omniray/omniray/tracing/otel.py index 1ed34c8..e1b472a 100644 --- a/packages/omniray/omniray/tracing/otel.py +++ b/packages/omniray/omniray/tracing/otel.py @@ -24,11 +24,14 @@ class OtelConfig: status: type[_StatusType] | None status_code: type[_StatusCodeType] | None span_type: type | None + context_api: object | None + trace_api: object | None def _init_otel(*, module_name: str) -> OtelConfig: """Initialize OpenTelemetry integration if available.""" try: + from opentelemetry import context as _context_api # noqa: PLC0415 from opentelemetry import trace as api # noqa: PLC0415 from opentelemetry.trace import INVALID_SPAN # noqa: PLC0415 from opentelemetry.trace import Span as _OtelSpan # noqa: PLC0415 @@ -42,6 +45,8 @@ def _init_otel(*, module_name: str) -> OtelConfig: status=_Status, status_code=_StatusCode, span_type=_OtelSpan, + context_api=_context_api, + trace_api=api, ) except ImportError: return OtelConfig( @@ -51,6 +56,8 @@ def _init_otel(*, module_name: str) -> OtelConfig: status=None, status_code=None, span_type=None, + context_api=None, + trace_api=None, ) @@ -77,5 +84,7 @@ def _check_otel_env(*, flag: bool | None, has_otel: bool) -> bool | None: Status = _otel.status StatusCode = _otel.status_code OtelSpan = _otel.span_type +context_api = _otel.context_api +trace_api = _otel.trace_api OTEL_FLAG = _check_otel_env(flag=_env_flag("OMNIRAY_OTEL"), has_otel=HAS_OTEL) diff --git a/packages/omniray/omniray/tracing/profilers.py b/packages/omniray/omniray/tracing/profilers.py index ed798e9..b62e232 100644 --- a/packages/omniray/omniray/tracing/profilers.py +++ b/packages/omniray/omniray/tracing/profilers.py @@ -58,16 +58,16 @@ def log_span_success( # noqa: PLR0913 rss_peak_mb: float | None = None, ) -> None: """Log span success with per-segment colored values.""" - body = _colored( - _bucket_color(duration_ms, _THRESHOLDS.duration_ms), + body = colored( + bucket_color(duration_ms, _THRESHOLDS.duration_ms), f"{duration_ms:.2f}ms", ) if input_size_mb is not None: - body += ", in: " + _format_mb(input_size_mb, _THRESHOLDS.size_mb) + body += ", in: " + format_mb(input_size_mb, _THRESHOLDS.size_mb) if output_size_mb is not None: - body += ", out: " + _format_mb(output_size_mb, _THRESHOLDS.size_mb) + body += ", out: " + format_mb(output_size_mb, _THRESHOLDS.size_mb) if rss_current_mb is not None: - body += ", rss: " + _format_mb(rss_current_mb, _THRESHOLDS.rss_mb) + body += ", rss: " + format_mb(rss_current_mb, _THRESHOLDS.rss_mb) extras = _format_rss_extras(rss_delta_mb, rss_peak_mb) if extras: body += f" ({extras})" @@ -104,12 +104,12 @@ def get_indent(depth: int, *, is_start: bool = True) -> str: return prefix + (NEST_START if is_start else NEST_END) -def _colored(color: str, text: str) -> str: +def colored(color: str, text: str) -> str: """Wrap *text* in *color* with a trailing style reset.""" return f"{color}{text}{Style.RESET_ALL}" -def _bucket_color(value: float, thresholds: tuple[float, float, float]) -> str: +def bucket_color(value: float, thresholds: tuple[float, float, float]) -> str: """Map *value* onto a DIM/GREEN/YELLOW/RED bucket using ``(low, medium, high)``.""" low, medium, high = thresholds if value < low: @@ -121,19 +121,19 @@ def _bucket_color(value: float, thresholds: tuple[float, float, float]) -> str: return Fore.RED + Style.BRIGHT -def _format_mb(value: float, thresholds: tuple[float, float, float], *, sign: bool = False) -> str: +def format_mb(value: float, thresholds: tuple[float, float, float], *, sign: bool = False) -> str: """Return a colored ``X.XXMB`` string; ``sign=True`` forces a leading +/-.""" spec = f"{value:+.2f}" if sign else f"{value:.2f}" - return _colored(_bucket_color(value, thresholds), f"{spec}MB") + return colored(bucket_color(value, thresholds), f"{spec}MB") def _format_rss_extras(rss_delta_mb: float | None, rss_peak_mb: float | None) -> str: """Build the ``Δ..., max: ...`` group (empty string when both inputs are ``None``).""" extras: list[str] = [] if rss_delta_mb is not None: - extras.append(DELTA + _format_mb(rss_delta_mb, _THRESHOLDS.rss_delta_mb, sign=True)) + extras.append(DELTA + format_mb(rss_delta_mb, _THRESHOLDS.rss_delta_mb, sign=True)) if rss_peak_mb is not None: - extras.append("max: " + _format_mb(rss_peak_mb, _THRESHOLDS.rss_mb)) + extras.append("max: " + format_mb(rss_peak_mb, _THRESHOLDS.rss_mb)) return ", ".join(extras) diff --git a/packages/omniray/omniray/tracing/thresholds.py b/packages/omniray/omniray/tracing/thresholds.py index f01c5e9..ed0df8f 100644 --- a/packages/omniray/omniray/tracing/thresholds.py +++ b/packages/omniray/omniray/tracing/thresholds.py @@ -50,7 +50,7 @@ def __post_init__(self) -> None: self._validate_triple("rss_delta", self.rss_delta) self._validate_triple("duration_ms", self.duration_ms) self._validate_scalar("duration_slow_tag_ms", self.duration_slow_tag_ms) - self._validate_bool("compact", self.compact) + self._validate_bool("compact", value=self.compact) self._validate_positive_int("compact_threshold", self.compact_threshold, minimum=2) def _validate_triple(self, name: str, value: list[float] | None) -> None: @@ -74,7 +74,7 @@ def _validate_scalar(self, name: str, value: float | None) -> None: msg = f"{name} must be numeric, got {type(value).__name__}" raise self.ConfigError(msg) - def _validate_bool(self, name: str, value: bool | None) -> None: # noqa: FBT001 + def _validate_bool(self, name: str, *, value: bool | None) -> None: if value is None: return if not isinstance(value, bool): diff --git a/packages/omniray/omniray/tracing/tracers.py b/packages/omniray/omniray/tracing/tracers.py index 7211cfc..17d9f55 100644 --- a/packages/omniray/omniray/tracing/tracers.py +++ b/packages/omniray/omniray/tracing/tracers.py @@ -10,6 +10,7 @@ from __future__ import annotations import time +from contextlib import suppress from contextvars import ContextVar from typing import TYPE_CHECKING @@ -25,7 +26,9 @@ OTEL_MISSING_MSG, Status, StatusCode, + context_api, otel_tracer, + trace_api, ) from omniray.tracing.rss import read_peak_rss_mb, read_rss_mb from omniray.tracing.sizing import measure_size_mb @@ -110,12 +113,10 @@ def trace( # noqa: PLR0913 result = wrapped(*args, **kwargs) except Exception as e: duration_s = time.time() - start_time - try: # noqa: SIM105 - tracing must never mask user exceptions + with suppress(Exception): cls._finish_tracing_failure( span, duration_s, span_name, current_depth, e, flags ) - except Exception: # noqa: BLE001, S110 - pass raise else: duration_s = time.time() - start_time @@ -130,10 +131,8 @@ def trace( # noqa: PLR0913 ) return result finally: - try: # noqa: SIM105 - tracing must never mask user exceptions + with suppress(Exception): cls._trace_duration(span, duration_s) - except Exception: # noqa: BLE001, S110 - pass finally: _call_depth.set(current_depth) @@ -331,12 +330,10 @@ async def trace( # noqa: PLR0913 result = await wrapped(*args, **kwargs) except Exception as e: duration_s = time.time() - start_time - try: # noqa: SIM105 - tracing must never mask user exceptions + with suppress(Exception): cls._finish_tracing_failure( span, duration_s, span_name, current_depth, e, flags ) - except Exception: # noqa: BLE001, S110 - pass raise else: duration_s = time.time() - start_time @@ -351,10 +348,8 @@ async def trace( # noqa: PLR0913 ) return result finally: - try: # noqa: SIM105 - tracing must never mask user exceptions + with suppress(Exception): cls._trace_duration(span, duration_s) - except Exception: # noqa: BLE001, S110 - pass finally: cls._exit_otel_span(span, token, flags) finally: @@ -365,13 +360,10 @@ def _enter_otel_span(span_name: str, flags: TraceFlags) -> tuple: """Start an OTel span with explicit attach — no generator, safe for async GC.""" if not flags.otel: return None, None - from opentelemetry import context as context_api # noqa: PLC0415 - from opentelemetry import trace as trace_api # noqa: PLC0415 - - # otel_tracer guaranteed non-None: guarded by flags.otel + HAS_OTEL + # otel_tracer/context_api/trace_api guaranteed non-None: guarded by flags.otel + HAS_OTEL span = otel_tracer.start_span(span_name) # type: ignore[union-attr] - ctx = trace_api.set_span_in_context(span) - token = context_api.attach(ctx) + ctx = trace_api.set_span_in_context(span) # type: ignore[union-attr] + token = context_api.attach(ctx) # type: ignore[union-attr] return span, token @staticmethod @@ -379,7 +371,5 @@ def _exit_otel_span(span: OtelSpan | None, token: object | None, flags: TraceFla """Detach context and end span. Counterpart to :meth:`_enter_otel_span`.""" if not flags.otel: return - from opentelemetry import context as context_api # noqa: PLC0415 - - context_api.detach(token) # type: ignore[arg-type] # Token[Context] stored as object + context_api.detach(token) # type: ignore[union-attr, arg-type] span.end() # type: ignore[union-attr] diff --git a/packages/omniray/tests/unit/tracing/test_profilers.py b/packages/omniray/tests/unit/tracing/test_profilers.py index 2d09077..ea5202a 100644 --- a/packages/omniray/tests/unit/tracing/test_profilers.py +++ b/packages/omniray/tests/unit/tracing/test_profilers.py @@ -320,9 +320,9 @@ def test_get_indent_depth_two(): ], ) def test_bucket_color_for_duration(monkeypatch, duration_ms, expected_color): - """Test _bucket_color returns correct color for different durations.""" + """Test bucket_color returns correct color for different durations.""" monkeypatch.setattr(profilers, "_THRESHOLDS", Thresholds()) - result = profilers._bucket_color(duration_ms, profilers._THRESHOLDS.duration_ms) + result = profilers.bucket_color(duration_ms, profilers._THRESHOLDS.duration_ms) assert result == expected_color @@ -440,7 +440,7 @@ def test_resolve_unicode_support_forced_style(monkeypatch, style, expected): ) def test_bucket_color_for_size(monkeypatch, value, expected): monkeypatch.setattr(profilers, "_THRESHOLDS", _DEFAULT_THRESHOLDS) - assert profilers._bucket_color(value, _DEFAULT_THRESHOLDS.size_mb) == expected + assert profilers.bucket_color(value, _DEFAULT_THRESHOLDS.size_mb) == expected @pytest.mark.parametrize( @@ -454,7 +454,7 @@ def test_bucket_color_for_size(monkeypatch, value, expected): ) def test_bucket_color_for_rss(monkeypatch, value, expected): monkeypatch.setattr(profilers, "_THRESHOLDS", _DEFAULT_THRESHOLDS) - assert profilers._bucket_color(value, _DEFAULT_THRESHOLDS.rss_mb) == expected + assert profilers.bucket_color(value, _DEFAULT_THRESHOLDS.rss_mb) == expected @pytest.mark.parametrize( @@ -472,4 +472,4 @@ def test_bucket_color_for_rss(monkeypatch, value, expected): def test_bucket_color_for_rss_delta(monkeypatch, value, expected): """Unified DIM/GREEN/YELLOW/RED ladder — negative/near-zero fall into ``< low`` → DIM.""" monkeypatch.setattr(profilers, "_THRESHOLDS", _DEFAULT_THRESHOLDS) - assert profilers._bucket_color(value, _DEFAULT_THRESHOLDS.rss_delta_mb) == expected + assert profilers.bucket_color(value, _DEFAULT_THRESHOLDS.rss_delta_mb) == expected diff --git a/pyproject.toml b/pyproject.toml index 81e9d3d..b98649d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ dev = [ "mypy>=1.15", "types-psutil>=7.0", "pip-licenses>=5.0", + "shamefile>=0.1.7", ] docs = [ "mkdocs-material>=9.0", diff --git a/shamefile.yaml b/shamefile.yaml new file mode 100644 index 0000000..f313763 --- /dev/null +++ b/shamefile.yaml @@ -0,0 +1,1064 @@ +# yamllint disable-file +--- +config: {} +entries: + + - location: ./benchmarks/bench_tracer_overhead.py:52 + token: '# noqa' + content: 'flags_mod._default_flags_cache.clear() # noqa: SLF001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + exposing a public reset API would widen the lib surface for one benchmark + call-site + + - location: ./benchmarks/bench_tracer_overhead.py:91 + token: '# noqa' + content: 'devnull = open(os.devnull, "w") # noqa: SIM115, PTH123' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + context manager + Path.open would skew the timings the benchmark is + measuring + + - location: ./examples/big_red_button/__main__.py:12 + token: '# noqa' + content: 'from examples.big_red_button.launch import BigRedButton # noqa: E402' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + imports above wrap_all() would not be traced (no module-level traceable + yet) + + - location: ./examples/big_red_button/app.py:19 + token: '# noqa' + content: 'from fastapi import FastAPI # noqa: E402' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + imports above wrap_all() would not be traced (no module-level traceable + yet) + + - location: ./examples/big_red_button/app.py:20 + token: '# noqa' + content: 'from fastapi.responses import HTMLResponse # noqa: E402' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + imports above wrap_all() would not be traced (no module-level traceable + yet) + + - location: ./examples/big_red_button/app.py:21 + token: '# noqa' + content: 'from starlette.responses import StreamingResponse # noqa: E402' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + imports above wrap_all() would not be traced (no module-level traceable + yet) + + - location: ./examples/big_red_button/app.py:23 + token: '# noqa' + content: 'from examples.big_red_button.launch import BigRedButton # noqa: E402' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + imports above wrap_all() would not be traced (no module-level traceable + yet) + + - location: ./packages/omniray/omniray/decorators.py:25 + token: '# noqa' + content: 'func._omniwrap_skip = True # type: ignore[attr-defined] # noqa: SLF001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + renaming the underscore would break the published wrap_all() opt-out + contract + + - location: ./packages/omniray/omniray/decorators.py:25 + token: '# type: ignore' + content: 'func._omniwrap_skip = True # type: ignore[attr-defined] # noqa: SLF001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + declaring the marker via Protocol would force every user function into a + custom type + + - location: ./packages/omniray/omniray/decorators.py:29 + token: '# noqa' + content: 'def trace[**P, T]( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + config-struct param would hide the 8 public knobs from IDE autocomplete + + - location: ./packages/omniray/omniray/decorators.py:82 + token: '# type: ignore' + content: 'return _exclude_from_omniwrap(async_wrapper) # type: ignore[return-value, arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrowing CallResult to T statically would need generic narrowing mypy + lacks + + - location: ./packages/omniray/omniray/decorators.py:101 + token: '# type: ignore' + content: 'return _exclude_from_omniwrap(sync_wrapper) # type: ignore[return-value]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrowing CallResult to T statically would need generic narrowing mypy + lacks + + - location: ./packages/omniray/omniray/decorators.py:106 + token: '# noqa' + content: 'def create_trace_wrapper( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + config-struct param would force users to import a config class for trivial + overrides + + - location: ./packages/omniray/omniray/tracing/compactor.py:51 + token: '# noqa' + content: 'def add( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + callers would allocate a metrics struct per call on the trace hot path + + - location: ./packages/omniray/omniray/tracing/compactor.py:154 + token: '# noqa' + content: 'def note_exit_success( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + callers would allocate a metrics struct per call on the trace hot path + + - location: ./packages/omniray/omniray/tracing/flags.py:49 + token: '# noqa' + content: 'def resolve_trace_flags( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'struct allocation per trace call would hurt the hot path' + + - location: ./packages/omniray/omniray/tracing/flags.py:102 + token: '# noqa' + content: 'def _resolve_all( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'splitting would duplicate parameter plumbing for no behavioral gain' + + - location: ./packages/omniray/omniray/tracing/otel.py:34 + token: '# noqa' + content: 'from opentelemetry import context as _context_api # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-top import would crash omniray install without the [otel] extra + + - location: ./packages/omniray/omniray/tracing/otel.py:35 + token: '# noqa' + content: 'from opentelemetry import trace as api # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-top import would crash omniray install without the [otel] extra + + - location: ./packages/omniray/omniray/tracing/otel.py:36 + token: '# noqa' + content: 'from opentelemetry.trace import INVALID_SPAN # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-top import would crash omniray install without the [otel] extra + + - location: ./packages/omniray/omniray/tracing/otel.py:37 + token: '# noqa' + content: 'from opentelemetry.trace import Span as _OtelSpan # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartlomiej Flis + why: >- + module-top import would crash omniray install without the [otel] extra + + - location: ./packages/omniray/omniray/tracing/otel.py:38 + token: '# noqa' + content: 'from opentelemetry.trace import Status as _Status # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartlomiej Flis + why: >- + module-top import would crash omniray install without the [otel] extra + + - location: ./packages/omniray/omniray/tracing/otel.py:39 + token: '# noqa' + content: 'from opentelemetry.trace import StatusCode as _StatusCode # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartlomiej Flis + why: >- + module-top import would crash omniray install without the [otel] extra + + - location: ./packages/omniray/omniray/tracing/profilers.py:49 + token: '# noqa' + content: 'def log_span_success( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + callers would allocate a metrics struct per call on the trace hot path + + - location: ./packages/omniray/omniray/tracing/rss.py:18 + token: '# pragma: no cover' + content: 'except ImportError: # pragma: no cover — Windows path' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'Linux CI cannot reach the Windows-only ImportError branch' + + - location: ./packages/omniray/omniray/tracing/rss.py:36 + token: '# noqa' + content: 'global _PROCESS # noqa: PLW0603 — singleton refreshed on fork (pid change)' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + removing the cache forces a psutil.Process() allocation on every traced + call + + - location: ./packages/omniray/omniray/tracing/rss.py:51 + token: '# noqa' + content: 'except Exception: # noqa: BLE001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrow except would let an unanticipated psutil bug crash the traced app + + - location: ./packages/omniray/omniray/tracing/rss.py:69 + token: '# noqa' + content: 'except Exception: # noqa: BLE001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrow except would let an unanticipated getrusage bug crash the traced + app + + - location: ./packages/omniray/omniray/tracing/sizing.py:24 + token: '# noqa' + content: 'except Exception: # noqa: BLE001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrow except would let an unanticipated pympler bug crash the traced app + + - location: ./packages/omniray/omniray/tracing/tracers.py:59 + token: '# noqa' + content: 'def trace( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + config-struct param would force allocation per traced call on the hot path + + - location: ./packages/omniray/omniray/tracing/tracers.py:108 + token: '# type: ignore' + content: 'context = otel_tracer.start_as_current_span(span_name) if flags.otel else NOOP_CONTEXT # type: ignore[union-attr]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'asserting non-None would add a runtime check on every trace call' + + - location: ./packages/omniray/omniray/tracing/tracers.py:109 + token: '# type: ignore' + content: 'with context as span: # type: ignore[union-attr]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrowing the union needs Protocol gymnastics over otel's heterogeneous + Spans + + - location: ./packages/omniray/omniray/tracing/tracers.py:147 + token: '# noqa' + content: 'def _finish_tracing( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + pre-measured metrics from the outer scope must reach loggers without + re-measuring + + - location: ./packages/omniray/omniray/tracing/tracers.py:202 + token: '# noqa' + content: 'def _finish_tracing_failure( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + splitting would force two call sites in the failure path passing the same + context + + - location: ./packages/omniray/omniray/tracing/tracers.py:264 + token: '# type: ignore' + content: 'span.set_status(Status(StatusCode.ERROR, str(exception))) # type: ignore[misc, union-attr]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'asserting non-None would add a runtime check on every span error' + + - location: ./packages/omniray/omniray/tracing/tracers.py:277 + token: '# noqa' + content: 'async def trace( # noqa: PLR0913' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + config-struct param would force allocation per traced call on the async + hot path + + - location: ./packages/omniray/omniray/tracing/tracers.py:364 + token: '# type: ignore' + content: 'span = otel_tracer.start_span(span_name) # type: ignore[union-attr]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + asserting non-None would add a runtime check on every async span start + + - location: ./packages/omniray/omniray/tracing/tracers.py:365 + token: '# type: ignore' + content: 'ctx = trace_api.set_span_in_context(span) # type: ignore[union-attr]' + created_at: 2026-05-17 + owner: Bartlomiej Flis + why: 'asserting non-None would add a runtime check on every trace call' + + - location: ./packages/omniray/omniray/tracing/tracers.py:366 + token: '# type: ignore' + content: 'token = context_api.attach(ctx) # type: ignore[union-attr]' + created_at: 2026-05-17 + owner: Bartlomiej Flis + why: 'asserting non-None would add a runtime check on every trace call' + + - location: ./packages/omniray/omniray/tracing/tracers.py:374 + token: '# type: ignore' + content: 'context_api.detach(token) # type: ignore[union-attr, arg-type]' + created_at: 2026-05-17 + owner: Bartlomiej Flis + why: 'asserting non-None would add a runtime check on every async span' + + - location: ./packages/omniray/omniray/tracing/tracers.py:375 + token: '# type: ignore' + content: 'span.end() # type: ignore[union-attr]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'asserting non-None would add a runtime check after every async span' + + - location: ./packages/omniray/tests/unit/tracing/test_console.py:12 + token: '# noqa' + content: 'from omniray.tracing.console import logger as console_logger # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would bind the handlers reference before setup runs + + - location: ./packages/omniray/tests/unit/tracing/test_console.py:26 + token: '# noqa' + content: 'from omniray.tracing.console import logger as console_logger # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would bind the handlers reference before setup runs + + - location: ./packages/omniray/tests/unit/tracing/test_console.py:33 + token: '# noqa' + content: 'import importlib # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: 'module-level import would add a stdlib dep used by only one test' + + - location: ./packages/omniray/tests/unit/tracing/test_console.py:37 + token: '# noqa' + content: 'import omniray.tracing.tracers # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would prime the cache before the test patches the flag + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:42 + token: '# type: ignore' + content: 'RawThresholds(size="foo") # type: ignore[arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + letting mypy fail would block the test that proves runtime rejection works + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:52 + token: '# type: ignore' + content: 'RawThresholds(size=[1, "bad", 3]) # type: ignore[list-item]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + letting mypy fail would block the test that proves runtime rejection works + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:63 + token: '# type: ignore' + content: 'RawThresholds(size_big_tag_mb="foo") # type: ignore[arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + letting mypy fail would block the test that proves runtime rejection works + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:68 + token: '# type: ignore' + content: 'RawThresholds(size_big_tag_mb=True) # type: ignore[arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + bool is structurally int to mypy; only the runtime check distinguishes + them + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:79 + token: '# type: ignore' + content: 'RawThresholds(compact="yes") # type: ignore[arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + letting mypy fail would block the test that proves runtime rejection works + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:97 + token: '# type: ignore' + content: 'RawThresholds(compact_threshold="five") # type: ignore[arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + letting mypy fail would block the test that proves runtime rejection works + + - location: ./packages/omniray/tests/unit/tracing/test_thresholds.py:103 + token: '# type: ignore' + content: 'RawThresholds(compact_threshold=True) # type: ignore[arg-type]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + bool is structurally int to mypy; only the runtime check distinguishes + them + + - location: ./packages/omniwrap/omniwrap/markers.py:19 + token: '# noqa' + content: 'func._omniwrap_skip = True # type: ignore[attr-defined] # noqa: SLF001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + renaming the underscore would break the published wrap_all() opt-out + contract + + - location: ./packages/omniwrap/omniwrap/markers.py:19 + token: '# type: ignore' + content: 'func._omniwrap_skip = True # type: ignore[attr-defined] # noqa: SLF001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + declaring the marker via Protocol would force every user function into a + custom type + + - location: ./packages/omniwrap/omniwrap/pyproject.py:54 + token: '# noqa' + content: 'except Exception as exc: # noqa: BLE001 — catch any validation failure in __post_init__' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + narrow except cannot enumerate everything users may raise from + __post_init__ + + - location: ./packages/omniwrap/omniwrap/pyproject.py:134 + token: '# type: ignore' + content: 'return raw_cls(**{k: v for k, v in data.items() if k in known_keys}) # type: ignore[return-value]' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + cast(T, ...) would just move the same suppression to a less direct site + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:64 + token: '# noqa' + content: 'from myapp.service import UserService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:83 + token: '# noqa' + content: 'from myapp.service import UserService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:102 + token: '# noqa' + content: 'from myapp.service import UserService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:120 + token: '# noqa' + content: 'from myapp.service import UserService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:139 + token: '# noqa' + content: 'from myapp.service import UserService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:161 + token: '# noqa' + content: 'from myapp.service import Calculator, greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:189 + token: '# noqa' + content: 'from myapp.service import UserService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_class_wrapping.py:190 + token: '# noqa' + content: 'from myapp.utils import Calculator, greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:200 + token: '# noqa' + content: 'from myapp.service import expensive, regular # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:216 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:237 + token: '# noqa' + content: 'from myapp.service import decorated, plain # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:253 + token: '# noqa' + content: 'from myapp.service import decorated, plain # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:272 + token: '# noqa' + content: 'from myapp.service import User # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:303 + token: '# noqa' + content: 'from myapp.service import Config # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:325 + token: '# noqa' + content: 'from myapp.service import ConcreteService # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:345 + token: '# noqa' + content: 'from myapp.service import plain, stacked_no_wraps, stacked_with_wraps # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:368 + token: '# noqa' + content: 'from myapp.service import decorated_fetch, plain_fetch # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_decorator_interactions.py:387 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_full_pipeline.py:20 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_full_pipeline.py:44 + token: '# noqa' + content: 'from myapp.service import fetch # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_full_pipeline.py:63 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_full_pipeline.py:64 + token: '# noqa' + content: 'from myapp.utils import helper # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_full_pipeline.py:90 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_full_pipeline.py:91 + token: '# noqa' + content: 'from myapp.utils import fetch # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_idempotency.py:36 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_idempotency.py:53 + token: '# noqa' + content: 'from myapp.service import fetch # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_idempotency.py:69 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_idempotency.py:94 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_idempotency.py:120 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_idempotency.py:136 + token: '# noqa' + content: 'from myapp.service import Service as Svc2 # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:36 + token: '# noqa' + content: 'from myapp.service import join, my_func # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:43 + token: '# noqa' + content: 'assert result == os.path.join("/tmp", "file") # noqa: PTH118' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + pathlib.join would no longer mirror what the test's target re-exports + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:53 + token: '# noqa' + content: 'from myapp.service import process # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:65 + token: '# noqa' + content: 'from myapp.service import basename, transform # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:91 + token: '# noqa' + content: 'from myapp.service import helper as imported_helper # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:92 + token: '# noqa' + content: 'from myapp.service import process # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_import_filtering.py:93 + token: '# noqa' + content: 'from myapp.utils import helper # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_multiple_wrappers.py:34 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_multiple_wrappers.py:65 + token: '# noqa' + content: 'from myapp.service import fetch # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_multiple_wrappers.py:83 + token: '# noqa' + content: 'from myapp.service import fetch, greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_multiple_wrappers.py:149 + token: '# noqa' + content: 'from myapp.service import fetch # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_multiple_wrappers.py:153 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_multiple_wrappers.py:172 + token: '# noqa' + content: 'from myapp.service import greet # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:71 + token: '# noqa' + content: 'from myapp.service import Service, ServiceError # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:75 + token: '# noqa' + content: 'raise ServiceError("test error") # noqa: EM101, TRY003, TRY301' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + moving the message to a constant would clutter the test for no production + benefit + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:90 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:94 + token: '# noqa' + content: 'raise Service.NotFoundError("not found") # noqa: EM101, TRY003, TRY301' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + moving the message to a constant would clutter the test for no production + benefit + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:109 + token: '# noqa' + content: 'from myapp.service import FatalError, Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:112 + token: '# noqa' + content: 'raise FatalError("fatal") # noqa: EM101, TRY301' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + moving the message to a constant would clutter the test for no production + benefit + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:126 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:158 + token: '# noqa' + content: 'from myapp.service import TimeoutError as SvcTimeout # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:159 + token: '# noqa' + content: 'from myapp.service import fetch, validate # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_rules.py:163 + token: '# noqa' + content: 'raise SvcTimeout("timed out") # noqa: EM101, TRY003, TRY301' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + moving the message to a constant would clutter the test for no production + benefit + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_config.py:46 + token: '# noqa' + content: 'from myapp.service import Conversation, Message # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_config.py:76 + token: '# noqa' + content: 'from myapp.service import Model # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_config.py:96 + token: '# noqa' + content: 'from myapp.service import Conversation # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_config.py:147 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_config.py:173 + token: '# noqa' + content: 'from myapp.service import healthcheck, process # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_marker.py:83 + token: '# noqa' + content: 'from myapp.service import healthcheck, process # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_marker.py:103 + token: '# noqa' + content: 'from myapp.service import fetch, healthcheck # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_marker.py:118 + token: '# noqa' + content: 'from myapp.service import Service # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_marker.py:135 + token: '# noqa' + content: 'from myapp.service import Internal, Public # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_marker.py:150 + token: '# noqa' + content: 'from myapp.service import Service, ServiceError, healthcheck # noqa: PLC0415' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + module-level import would resolve before the fixture builds the temp + module + + - location: ./packages/omniwrap/tests/e2e/test_skip_wrap_marker.py:154 + token: '# noqa' + content: 'raise ServiceError("err") # noqa: EM101, TRY301' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + moving the message to a constant would clutter the test for no production + benefit + + - location: ./packages/omniwrap/tests/unit/test_performance.py:15 + token: '# noqa' + content: 'def _noop_wrapper(wrapped, instance, args, kwargs): # noqa: ARG001' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + wrapt protocol fixes the signature; removing instance would break the call + + - location: ./packages/omniwrap/tests/unit/wrapper/test_is_defined_in_module.py:33 + token: '# noqa' + content: 'f = lambda: None # noqa: E731' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + converting to def would no longer test the lambda branch the test targets + + - location: ./packages/omniwrap/tests/unit/wrapper/test_is_defined_in_module.py:61 + token: '# noqa' + content: 'f = lambda: None # noqa: E731' + created_at: 2026-05-17 + owner: Bartłomiej Flis <97804977+BKDDFS@users.noreply.github.com> + why: >- + converting to def would no longer test the lambda branch the test targets diff --git a/uv.lock b/uv.lock index 65e3e1a..0b69a05 100644 --- a/uv.lock +++ b/uv.lock @@ -639,6 +639,7 @@ dev = [ { name = "pytest-cov" }, { name = "pytest-mock" }, { name = "ruff" }, + { name = "shamefile" }, { name = "types-psutil" }, ] docs = [ @@ -658,6 +659,7 @@ requires-dist = [ { name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=6.0" }, { name = "pytest-mock", marker = "extra == 'dev'", specifier = ">=3.14" }, { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.12" }, + { name = "shamefile", marker = "extra == 'dev'", specifier = ">=0.1.7" }, { name = "types-psutil", marker = "extra == 'dev'", specifier = ">=7.0" }, ] provides-extras = ["dev", "docs"] @@ -1152,6 +1154,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/63/b6/aeadee5443e49baa2facd51131159fd6301cc4ccfc1541e4df7b021c37dd/ruff-0.15.11-py3-none-win_arm64.whl", hash = "sha256:063fed18cc1bbe0ee7393957284a6fe8b588c6a406a285af3ee3f46da2391ee4", size = 11032614, upload-time = "2026-04-16T18:46:34.487Z" }, ] +[[package]] +name = "shamefile" +version = "0.1.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/5c/85217703cba173f8deffd5e4decbb9da34a4710c4ac582b6e68526b75140/shamefile-0.1.7.tar.gz", hash = "sha256:f52d4a1f38bb3e6624932c42ff2094b9c7c7fe540a72cc22f69a8218ba2726af", size = 792310, upload-time = "2026-05-17T16:26:39.709Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/2a/91a01f33b36e4434a969a18b3b08186fb8d9d67956a27a03e4e95730f53f/shamefile-0.1.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:77dc887d85beb90b7cc4f80618fe7432e740c7562d1d44162a7fff2d28c0587f", size = 1821885, upload-time = "2026-05-17T16:26:25.076Z" }, + { url = "https://files.pythonhosted.org/packages/3e/24/18367b8d3f555e4bcdd1813ba19e5dd5ac8a2a09bf71690843d8bf779102/shamefile-0.1.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5f8bdb72b891bda65dc35d8bbc73189ac292bbc78c78d70265390b261f5b0b45", size = 1772122, upload-time = "2026-05-17T16:26:27.267Z" }, + { url = "https://files.pythonhosted.org/packages/74/9e/a59cd030a80189fd11bc4eb01ea9f73b680b44bce68b68babf461dee8cb6/shamefile-0.1.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b3aeddd55b3bfc0d426ceaf0ba32b9e0f8b7a21c517592d691c1ab8ff9c48bc1", size = 1800157, upload-time = "2026-05-17T16:26:29.314Z" }, + { url = "https://files.pythonhosted.org/packages/5c/e3/53fa519b069977cfd8e5a85576c440b90bb18401a75bbc750f282d187453/shamefile-0.1.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b5b38afce4d65e8ea0a42bba1fe7e7c89acb0ff3773a780cf0d6aa73c62d10d", size = 1894528, upload-time = "2026-05-17T16:26:30.771Z" }, + { url = "https://files.pythonhosted.org/packages/05/23/ad16650639a265066300b1e3ba2d5dd649e9721eb4b83132fa20c3fbb89f/shamefile-0.1.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:091b0e4c745e628ecf69d3c531fa0cf1851062ad2c892009a57c47ebf8b5ac41", size = 1803992, upload-time = "2026-05-17T16:26:32.743Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ba/5b12704f34329e978964caf11ef06addf80b240aeb4172be47301b20f56f/shamefile-0.1.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a0e6faaad3e44b25f0e0101a6c47d2c9ca1f99e9fba6d148170a5a0598d546d4", size = 1964758, upload-time = "2026-05-17T16:26:34.689Z" }, + { url = "https://files.pythonhosted.org/packages/13/9d/f1319810845585410d69620f351294508f2d0fdb35c0cdf8dd554b0ec9de/shamefile-0.1.7-py3-none-win_amd64.whl", hash = "sha256:1b336e2e607c600299b81c98e0aeb57daac763deec8934d7a584491ab23b0453", size = 1776444, upload-time = "2026-05-17T16:26:36.931Z" }, + { url = "https://files.pythonhosted.org/packages/9d/f2/b18eef95b1a498212aff6d065955731e96d1f39164ba6975821808b6cb2b/shamefile-0.1.7-py3-none-win_arm64.whl", hash = "sha256:ec63f45a4c72bcd574f5c0b20807c913636610da88b934d24eaeac96d0bc8ba2", size = 1679572, upload-time = "2026-05-17T16:26:38.378Z" }, +] + [[package]] name = "six" version = "1.17.0"