Skip to content

Clear ruff debt and make full-tree ruff check a CI gate#1

Merged
kosminus merged 2 commits into
mainfrom
chore/ruff-clean-ci-gate
May 25, 2026
Merged

Clear ruff debt and make full-tree ruff check a CI gate#1
kosminus merged 2 commits into
mainfrom
chore/ruff-clean-ci-gate

Conversation

@kosminus
Copy link
Copy Markdown
Owner

Summary

Clears all pre-existing ruff lint debt so ruff check src/ passes on the full tree, then turns it into a hard CI gate (replacing the previous non-blocking informational step). Also fixes the QueryWise link in the README.

Lint fixes

  • UP042 — convert str + Enum classes to StrEnum: ConnectorType, ValidationStatus, LLMProviderType, QueryComplexity. Behavior is equivalent for how they're used (value comparisons, .value access, value lookup, dict keys — verified at runtime).
  • B904 — chain re-raised ValueErrors with from err in connector_registry and provider_registry.
  • B905 — pass strict=True to zip() in db/vectors._cosine (lengths already guarded equal).
  • E402 — move the logger assignment below imports in context_builder and glossary_resolver.
  • N818 — rename EmbeddingsUnavailableEmbeddingsUnavailableError (internal-only, all refs in one file).
  • E501 — reflow genuine code lines (glossary_resolver, schema_linker, sample_data); waive prompt-template and IFRS 9 seed-data string literals via [tool.ruff.lint.per-file-ignores] (llm/prompts/*, llm/agents/error_handler.py, services/setup_service.py).

CI

.github/workflows/ci.yml now runs a single gating ruff check src/ step; the server.py-only step and the continue-on-error full-tree step are removed.

Verification

Ran locally on the branch:

  • ruff check src/ → All checks passed
  • python -m compileall src/ → OK
  • python -c "import querywise_mcp.server" → import OK

🤖 Generated with Claude Code

kosminus and others added 2 commits May 25, 2026 21:51
Fix all pre-existing lint issues so `ruff check src/` passes, then drop the
non-blocking informational full-tree step in favor of a single gating step.

- UP042: convert str+Enum classes to StrEnum (ConnectorType, ValidationStatus,
  LLMProviderType, QueryComplexity); behavior is equivalent (value comparisons,
  .value access, value lookup, dict keys all unchanged)
- B904: chain re-raised ValueErrors with `from err` in the registries
- B905: pass strict=True to zip() in db/vectors._cosine
- E402: move logger assignment below imports in the semantic resolvers
- N818: rename EmbeddingsUnavailable -> EmbeddingsUnavailableError (internal)
- E501: reflow real code lines; waive prompt-template and IFRS 9 seed-data
  string literals via [tool.ruff.lint.per-file-ignores]

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the local ../querywise path with https://github.com/kosminus/querywise.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kosminus kosminus merged commit 7bf9722 into main May 25, 2026
2 checks passed
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.

1 participant