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

Additional static analysis rules #261

Open
jtherrmann opened this issue Feb 11, 2025 · 3 comments
Open

Additional static analysis rules #261

jtherrmann opened this issue Feb 11, 2025 · 3 comments

Comments

@jtherrmann
Copy link
Contributor

jtherrmann commented Feb 11, 2025

This issue is a place to suggest additional static analysis rules (e.g. for ruff or mypy) that we would find useful, that are not currently listed in our recommended ruff config or recommended mypy config.

I'm not sure the best way to proceed with adopting additional rules, since doing an actions release just to update the README feels a bit cumbersome. I also don't want to feel compelled to update the ruff config in all of our repos every time we add a new rule. Maybe just a bumpless merge into develop to update the README, and then incorporating the additional rules into individual repos as we see fit?

Anyway, this issue can serve as a list of proposed rule additions for now. Anyone should feel free to edit this list to add more.

Ruff

Mypy

Other

@jhkennedy
Copy link
Contributor

I'm not sure the best way to proceed with adopting additional rules, since doing an actions release just to update the README feels a bit cumbersome. I also don't want to feel compelled to update the ruff config in all of our repos every time we add a new rule. Maybe just a bumpless merge into develop to update the README, and then incorporating the additional rules into individual repos as we see fit?

I think if we want to adopt a new rule, this process would suffice:

  1. PR to develop updating the README + Changelog stating we adopted the new rule with the pyproject.toml snippet to include
  2. Release actions
  3. Dependabot PRs to downstream repos can choose to include it in the pyproject.toml at that time or just add it as a commented-out rule to eventually come back to.

We don't necessarily need to release actions (step 2) if there are just README+Changelog changes, so things can sit in development ( after step 1) for a time until there's a need for an actions release, or we want to tackle the rule changes prompted b a release.

I think the challenge is making sure to come back to commented-out rules. 🤔 Could make use of a tracking issue with sub-tasks for each repo, but that is potentially likely to go out of date if everyone doesn't follow the process.

@jtherrmann
Copy link
Contributor Author

jtherrmann commented Feb 11, 2025

Dependabot PRs to downstream repos can choose to include it in the pyproject.toml at that time or just add it as a commented-out rule to eventually come back to.

Yeah, I like that. Adding as a commented-out rule would increase the likelihood of remembering to enable it for repos we're actively developing.

We don't necessarily need to release actions (step 2) if there are just README+Changelog changes, so things can sit in development ( after step 1) for a time until there's a need for an actions release, or we want to tackle the rule changes prompted b a release.

We could add an [Unreleased] section to the CHANGELOG where we queue up added rules.

@jtherrmann
Copy link
Contributor Author

jtherrmann commented Feb 11, 2025

I think the challenge is making sure to come back to commented-out rules. 🤔 Could make use of a tracking issue with sub-tasks for each repo, but that is potentially likely to go out of date if everyone doesn't follow the process.

I don't see us doing that en masse for all of our repos, since fixing static analysis errors in all ~23 of our Python projects at once has proved to be a very time-consuming process. But we could make a habit of uncommenting additional rules (and fixing the resulting errors) in pyproject.toml whenever we resume significant development work on a particular project.

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

No branches or pull requests

2 participants