-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Address repo-review suggestions #8239
Comments
Most of these seem quite reasonable! And cool that there's an automated review tool. (One that I would suggest we don't do is mypy strict mode, which is really really strict, and instead pick off some parts of that and gradually apply them through the repo..., e.g. #8198) |
I worked on the pytest config in #8246. We cannot follow the suggestions exactly because:
|
Hi @dcherian I've reviewed the open issues. Before diving in, I wanted to reach out and confirm if the issue is still relevant and open for contributions. if there are any specific guidelines or best practices you'd like me to follow. |
This issue definitely is still up for grabs, with the easiest being the items in the I wouldn't recommend doing too much in a single PR: for example, if you were to add the |
One PR per change seems totally reasonable. When finalizing this issue, those commits should also be put in the .git-blame-ignore-revs to make usage of blame easier. |
FWIW the codespell is not really recommended as pre-commit hook - see discussion in #6316 edit: better formulation |
Updated to only show errors. |
What is your issue?
Here's the output from the Scientific Python Repo Review tool.
There's an online version here.
On mac I run
A lot of these seem fairly easy to fix. I'll note that there's a large number of
mypy
config suggestions.General
setuptools.build_meta
Projects must have a
noxfile.py
ortox.ini
to encourage new contributors.PyProject
See #8239 (comment)
xfail_strict
should be set. You can manually specify if a check should be strict when setting each xfail.-ra
should be inaddopts = [...]
(print summary of all fails/errors).Pre-commit
Use
https://github.com/psf/black-pre-commit-mirror
instead ofhttps://github.com/psf/black
in.pre-commit-config.yaml
Must have
https://github.com/codespell-project/codespell
repo in.pre-commit-config.yaml
Must have
https://github.com/pre-commit/pygrep-hooks
repo in.pre-commit-config.yaml
Must have
https://github.com/pre-commit/mirrors-prettier
repo in.pre-commit-config.yaml
If
--fix
is present,--show-fixes
must be too.Should have something like this in
.pre-commit-config.yaml
:MyPy
Must have
strict
in the mypy config. MyPy is best with strict or nearly strict configuration. If you are happy with the strictness of your settings already, ignore this check or setstrict = false
explicitly.Must have
warn_unreachable = true
to pass this check. There are occasionally false positives (often due to platform or Python version static checks), so it's okay to ignore this check. But try it first - it can catch real bugs too.Must have
"ignore-without-code"
inenable_error_code = [...]
. This will force all skips in your project to include the error code, which makes them more readable, and avoids skipping something unintended.Must have
"redundant-expr"
inenable_error_code = [...]
. This helps catch useless lines of code, like checking the same condition twice.Must have
"truthy-bool"
inenable_error_code = []
. This catches mistakes in using a value as truthy if it cannot be falsey.Ruff
Must select the flake8-bugbear
B
checks. Recommended:The text was updated successfully, but these errors were encountered: