Skip to content

LCORE-1415: Removed unused noqa directives#1274

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:lcore-1415-removed-unused-noqa-directives
Mar 5, 2026
Merged

LCORE-1415: Removed unused noqa directives#1274
tisnik merged 1 commit into
lightspeed-core:mainfrom
tisnik:lcore-1415-removed-unused-noqa-directives

Conversation

@tisnik

@tisnik tisnik commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Description

LCORE-1415: Removed unused noqa directives

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-1415

Summary by CodeRabbit

  • Bug Fixes

    • Improved quota token consumption handling with atomic database operations.
  • Chores

    • Enhanced linting rule coverage for code quality.
    • Improved subprocess error handling for better robustness.
    • Removed unnecessary code annotations and cleaned up formatting across tests and source files.

@coderabbitai

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b3a54b94-fd61-4405-af92-51125a091806

📥 Commits

Reviewing files that changed from the base of the PR and between b57487c and 0f6a9a8.

📒 Files selected for processing (10)
  • pyproject.toml
  • scripts/generate_openapi_schema.py
  • src/models/config.py
  • src/quota/quota_exceed_error.py
  • src/quota/sql.py
  • tests/integration/test_version.py
  • tests/unit/__init__.py
  • tests/unit/app/endpoints/test_streaming_query.py
  • tests/unit/app/test_routers.py
  • tests/unit/utils/test_responses.py

Walkthrough

Adds RUF100 to Ruff lint configuration, removes inline noqa comments from source and test files, updates SQL token consumption queries to use upsert semantics with ON CONFLICT clauses, and modifies subprocess call to capture output and check exit codes.

Changes

Cohort / File(s) Summary
Linting Configuration
pyproject.toml
Adds RUF100 rule to Ruff's extend-select list to enable additional linting checks.
SQL Query Logic Update
src/quota/sql.py
Updates CONSUME_TOKENS_FOR_USER_SQLITE and CONSUME_TOKENS_FOR_USER_PG to introduce upsert behavior using ON CONFLICT/DO UPDATE semantics, allowing tokens to increment on duplicate keys instead of insertion failure; removes trailing noqa comments.
Subprocess Enhancement
scripts/generate_openapi_schema.py
Adds capture_output=True and check=True parameters to subprocess.run call to capture command output and automatically raise exceptions on non-zero exit codes.
Source Code Linting Cleanup
src/models/config.py, src/quota/quota_exceed_error.py
Removes inline noqa comment markers from error message strings; no change to message content or error handling logic.
Test Files Linting Cleanup
tests/integration/test_version.py, tests/unit/app/endpoints/test_streaming_query.py, tests/unit/app/test_routers.py, tests/unit/utils/test_responses.py, tests/unit/__init__.py
Removes inline noqa comments from test imports and test helper assignments; no functional changes to test execution or behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change—removing unused noqa directives across multiple files. It is concise, clear, and directly related to the changeset's primary purpose.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@tisnik tisnik merged commit e00ec21 into lightspeed-core:main Mar 5, 2026
22 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