Skip to content

fix: correct import sorting and pin tool versions to fix CI lint#153

Open
Ckk3 wants to merge 5 commits intogazorby:mainfrom
Ckk3:fix/lint-import-sorting
Open

fix: correct import sorting and pin tool versions to fix CI lint#153
Ckk3 wants to merge 5 commits intogazorby:mainfrom
Ckk3:fix/lint-import-sorting

Conversation

@Ckk3
Copy link
Contributor

@Ckk3 Ckk3 commented Mar 4, 2026

Description

Fix CI lint failures caused by incorrect import sorting (I001 errors) and tool version drift between local and CI environments.

Root cause: A stale .ruff_cache locally masked import sorting errors. Ruff auto-detected strawberry as first-party (due to __pycache__ artifacts in src/strawchemy/strawberry/), while CI correctly classified it as third-party.

Changes:

  • Fix import sorting across 84 files — properly separate strawberry (third-party) from strawchemy (first-party)
  • Pin ruff version in pyproject.toml (>=0.14.10,<0.15)
  • Pin mise version in CI to 2025.12.12 (matching tools/mise wrapper)
  • Fix pre-commit hooks: bump ruff-pre-commit to v0.14.10, use tools/mise path, fix language: system
  • Fix render:usage task to use tools/mise

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Issues Fixed or Closed by This PR

N/A

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Summary by CodeRabbit

  • Chores
    • Updated development tooling and CI configuration to improve consistency and code quality checks.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

This PR updates development tooling configurations by upgrading ruff to v0.14.10 with version pinning, updating CI cache identifiers, adjusting pre-commit and mise task invocations to use qualified paths, and expanding pyproject.toml source paths and exclusions.

Changes

Cohort / File(s) Summary
CI Cache Configuration
.github/workflows/ci.yaml
Updated cache key identifier from nox to nox-v2 for pip and nox caching steps.
Development Tool Configuration
.pre-commit-config.yaml, mise.toml, pyproject.toml
Upgraded ruff from v0.13.0 to v0.14.10 with pinned version constraints (>=0.14.10,<0.15); adjusted lint and task-docs hooks to use qualified tools/mise paths; added --fix flag to ruff-check; expanded pyproject.toml source paths from ["src/strawchemy", "tests"] to ["src", "tests"] and added __pycache__ to exclusions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Ruff's upgraded to point-one-four,
Cache keys shuffled, paths evermore,
Tools qualified with qualified grace,
Dev workflows bloom in organized space! 🌿

🚥 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 objectives of the PR: pinning tool versions and fixing import sorting issues in CI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.28%. Comparing base (fe8ade9) to head (58590d5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #153   +/-   ##
=======================================
  Coverage   94.28%   94.28%           
=======================================
  Files          69       69           
  Lines        5814     5814           
  Branches      770      770           
=======================================
  Hits         5482     5482           
  Misses        190      190           
  Partials      142      142           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Ckk3 Ckk3 changed the title fix: sort imports across codebase to pass CI lint checks fix: correct import sorting and pin tool versions to fix CI lint Mar 4, 2026
Ckk3 added 3 commits March 4, 2026 19:20
…classification

The ruff `src = ["src/strawchemy"]` setting caused ruff to auto-detect
subdirectories like `sqlalchemy/` and `strawberry/` (from __pycache__)
as first-party packages. Changed to `src = ["src"]` so only `strawchemy`
is detected as a source package. Also pinned ruff in pre-commit unasyncd
hook to prevent version drift.
@Ckk3 Ckk3 marked this pull request as ready for review March 5, 2026 14:27
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.pre-commit-config.yaml:
- Line 59: The YAML uses spaced bracket array syntax which triggers yamllint
`brackets` errors: update the entries for additional_dependencies to use compact
brackets without spaces (e.g., change additional_dependencies: [
"ruff>=0.14.10,<0.15" ] to additional_dependencies: ["ruff>=0.14.10,<0.15"]) and
make the same change for the other occurrence; ensure you only remove the space
after `[` and before `]` while keeping the string contents unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c59009c-88d6-4b92-8a94-a0bddc589d9b

📥 Commits

Reviewing files that changed from the base of the PR and between fe8ade9 and 58590d5.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/ci.yaml
  • .pre-commit-config.yaml
  • mise.toml
  • pyproject.toml

hooks:
- id: unasyncd
additional_dependencies: [ "ruff" ]
additional_dependencies: [ "ruff>=0.14.10,<0.15" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix YAML bracket spacing to clear lint errors.

Line 59 and Line 76 use spaced bracket style that triggers YAMLlint brackets errors.

Proposed fix
-        additional_dependencies: [ "ruff>=0.14.10,<0.15" ]
+        additional_dependencies: ["ruff>=0.14.10,<0.15"]
...
-        types: [ python ]
+        types: [python]

Also applies to: 76-76

🧰 Tools
🪛 YAMLlint (1.38.0)

[error] 59-59: too many spaces inside brackets

(brackets)


[error] 59-59: too many spaces inside brackets

(brackets)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml at line 59, The YAML uses spaced bracket array
syntax which triggers yamllint `brackets` errors: update the entries for
additional_dependencies to use compact brackets without spaces (e.g., change
additional_dependencies: [ "ruff>=0.14.10,<0.15" ] to additional_dependencies:
["ruff>=0.14.10,<0.15"]) and make the same change for the other occurrence;
ensure you only remove the space after `[` and before `]` while keeping the
string contents unchanged.

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