Skip to content

fix(xtest): satisfy ruff on otdf-local's golden-key loader - #687

Merged
dmihalcik-virtru merged 1 commit into
mainfrom
fix-otdf-local-ruff-golden-keys
Oct 30, 2026
Merged

dmihalcik-virtru merged 1 commit into
mainfrom
fix-otdf-local-ruff-golden-keys

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

main fails the scriptcheck job's "Lint and test otdf-local" step since #647 (run on 178baa1). ruff 0.17.0 reports:

  • TRY004 at otdf_local/utils/keys.py:233 and :241: two isinstance checks in _read_extra_keys raise ValueError.
  • I001 at tests/test_golden_keys.py:8: the first-party import group isn't separated from pytest.

While these are assertions of values, since they are on data from JSON objects, ValueError is more correct.

Changes

  • Keep ValueError for those two checks and add # noqa: TRY004. The function's docstring promises a ValueError naming the file for every problem with extra-keys.json, and PlatformService._preflight catches ValueError to report it as a start error. Switching to TypeError to satisfy the rule would break that.
  • ruff check --fix on the test's imports.

Testing

Run locally in otdf-local/:

  • uv run ruff check . and uv run ruff format --check .: clean.
  • uv run pyright: 0 errors.
  • uv run pytest: 109 passed.

The same commit is also on #624, which hit this failure after rebasing onto main.

Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
@dmihalcik-virtru
dmihalcik-virtru requested review from a team as code owners October 29, 2026 19:50
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be6db681-ed52-4c07-a85c-f6c7040948cd
Commits

Reviewing files that changed from the base of the PR and between 178baa1 and df56a30.

Files selected for processing: 2
  • otdf-local/src/otdf_local/utils/keys.py
  • otdf-local/tests/test_golden_keys.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@dmihalcik-virtru dmihalcik-virtru changed the title fix(otdf-local): satisfy ruff on the golden-key loader fix(xtest): satisfy ruff on otdf-local's golden-key loader Oct 29, 2026
@dmihalcik-virtru
dmihalcik-virtru merged commit 24ce6a6 into main Oct 30, 2026
24 of 25 checks passed
@dmihalcik-virtru
dmihalcik-virtru deleted the fix-otdf-local-ruff-golden-keys branch October 30, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants