Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-45794: Update the shared Ruff configuration #266

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

rra
Copy link
Member

@rra rra commented Aug 15, 2024

  • Exclude ASYNC109, which required adjusting the comment column
  • Drop the S113 exclusion, since its httpx bug was fixed
  • Add additional per-file exclusions useful for vertical monorepos
  • Drop the McCabe complexity override

The exclusions for vertical monorepos unfortunately appear to require duplicating the exclusion lists, or at least I don't know a way to write a glob that matches the paths both with and without a prefix. Since they have to be duplicated, I made them exact copies so that future maintenance is an easy cut and paste.

The McCabe complexity threshold increase from 10 to 11 was something I added for Gafaelfawr, but I found a better way to break apart the relevant Gafaelfawr function and other packages appear to not have trouble with a limit of 10.

- Exclude ASYNC109, which required adjusting the comment column
- Drop the S113 exclusion, since its httpx bug was fixed
- Add additional per-file exclusions useful for vertical monorepos
- Drop the McCabe complexity override

The exclusions for vertical monorepos unfortunately appear to require
duplicating the exclusion lists, or at least I don't know a way to
write a glob that matches the paths both with and without a prefix.
Since they have to be duplicated, I made them exact copies so that
future maintenance is an easy cut and paste.

The McCabe complexity threshold increase from 10 to 11 was something
I added for Gafaelfawr, but I found a better way to break apart the
relevant Gafaelfawr function and other packages appear to not have
trouble with a limit of 10.
@rra rra requested a review from jonathansick August 15, 2024 18:28
Copy link
Member

@jonathansick jonathansick left a comment

Choose a reason for hiding this comment

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

Is the idea that ruff-shared.toml should be the same between the PyPI and FastAPI templates? If that's the case we could explore turning ruff-shared.toml into a file template and then experiment with either a symlinking or adding something to the post gen hook that copies the file into place so that it's ultimately single-source. I don't know if that makes it harder to keep track of or not, though.

@rra
Copy link
Member Author

rra commented Aug 15, 2024

Yes, indeed, I think we can just share the same copy everywhere, and I haven't figured out the best way to do that yet. I'm on board with doing it -- it just wasn't immediately obvious to me how that worked. Is there a place where we're already using that pattern? If I have a model to follow, I can make that change as a separate PR.

@rra rra merged commit 3d1cd08 into main Aug 15, 2024
4 checks passed
@rra rra deleted the tickets/DM-45794 branch August 15, 2024 23:17
@jonathansick
Copy link
Member

I thought I had done this with the license/COPYRIGHT files and perhaps the stack_package template, but when I checked I couldn't find any evidence I'd done this. So this might be a feature that we support when we revamp templatekit at some point.

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.

2 participants