Update pre-commit to all files and Mypy setup#247
Conversation
Reviewer's GuideIntegrate Mypy type checking and Ruff-based linting/formatting into CI and project configuration, migrate build backend to poetry-core, apply pre-commit across all files, and standardize code and documentation formatting. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for adding the Here's a preview of the changelog: This release does not introduce any new features or bug fixes. It focuses solely on internal code quality improvements. Changes:
These changes aim to improve maintainability and ensure better development practices moving forward. |
There was a problem hiding this comment.
Hey @Ckk3 - I've reviewed your changes - here's some feedback:
- Remove the
test_without_pre_commitdummy function before merging, as it’s only intended to trigger lint failures. - Add a mypy type‐checking step to your CI workflows (e.g. GitHub Actions) to ensure the new mypy.ini is actually enforced.
- Make sure the pydantic mypy plugin is added to the project’s dev dependencies so mypy can load it successfully.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟡 Testing: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
CodSpeed Performance ReportMerging #247 will not alter performanceComparing Summary
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #247 +/- ##
==========================================
- Coverage 89.94% 89.72% -0.23%
==========================================
Files 17 17
Lines 1939 1936 -3
Branches 141 145 +4
==========================================
- Hits 1744 1737 -7
- Misses 123 125 +2
- Partials 72 74 +2 🚀 New features to boost your workflow:
|
…nvalid rules in lint
|
@sourcery-ai review |
|
@sourcery-ai summary |
There was a problem hiding this comment.
We encountered an error and are unable to review this PR. We have been notified and are working to fix it.
You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @Ckk3 - I've reviewed your changes - here's some feedback:
- This PR bundles extensive config and formatting changes—consider splitting into separate PRs (e.g., one for pre-commit/ruff setup, another for mypy integration, and a third for code formatting) to simplify review.
- The current ruff.ignore list is very broad; pruning these ignores gradually will help tighten lint enforcement and catch more issues moving forward.
- In your CI mypy step, consider enabling stricter flags (e.g. --strict or enabling missing imports/stubs reporting) to enforce stronger type safety across the codebase.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Hey @Ckk3 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
38c8189
into
strawberry-graphql:pre-commit-lint-and-format-update
* Update pre-commit and CI to ensure format and lint (#248) * Adding the changes we made in precommit, poetry, nox * add release.md * Update pre-commit to all files and Mypy setup (#247) * Update pre-commit and mypy .ini just like the main strawberry project * add a lint error on purpose to test lint * add a release md and add file attr to tmol pre-commit * fix test action to run when a PR is ready for review * test mappe * fix action * continue with tests in lint in nox file * remove pydantic.mypy plugin * made first lint ajustment, but still missing lint test * add ruff and black to lint te * Fix nox file and add ruff to pyptoject toml * fix poetry lock * fix command to raise error * make ruff output errors * bring back black to pre-commit * remove --diff from ruff because we want to run in all files, remove invalid rules in lint * update pre-commit to ruff run lint and formatter * separate ruff lint from formater in noxfile * remove test function from mapper * remove black and use only ruff * add lint tag to ruff format in nox * change test.yml to run lint and format divided * Run pre-commit in all files and made line-lenght 100 * updated ruff check * update pyproject.toml * Made sourcery fixes * remove unecessary else * bring back session._session

Description
This PR introduces a mypy configuration similar to the one used in the main Strawberry project, and integrates a type-checking step into the CI workflows to ensure type safety is enforced consistently across the codebase.
Additionally, I ran
pre-commiton all files, as many had not been formatted previously and did not follow the project's linting architecture. This helps standardize the codebase and reduce noise in future diffs.Types of Changes
Issues Fixed or Closed by This PR
Checklist
Summary by Sourcery
Enforce consistent code style and type safety by running pre-commit across the codebase, integrating a shared mypy configuration with CI type-checking, and consolidating linting/formatting into Ruff
Enhancements:
Build:
CI:
Documentation:
Chores: