-
Notifications
You must be signed in to change notification settings - Fork 15
Dependabot, pre commit, and ruff configuration #73
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
Conversation
4bee271
to
fcd139f
Compare
- repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated | ||
rev: v3.4.2 | ||
hooks: | ||
- id: prettier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For formatting a bunch of files (markdown, css, yaml, etc). See list of supported files
# TODO: These should be fixed | ||
"B006", # Do not use mutable data structures for argument defaults | ||
"B007", # Loop control variable `funcs` not used within loop body | ||
"B011", # Do not `assert False` | ||
"B028", # No explicit `stacklevel` keyword argument found | ||
"B904", # Within an `except` clause, raise exceptions | ||
"RUF001", # String contains ambiguous ... | ||
"E402", # Module level import not at top of file | ||
"E711", # Comparison to `None` should be `cond is None` | ||
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks | ||
"F401", # ... imported but unused; consider removing, adding to `__all__`, or using a redundant alias | ||
"ICN", # import conventions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, these would be ones to consider fixing (not in this PR, but can be done gradually by removing from ignore and then running pre-commit). More info can be found by googling "{code} ruff". If you feel some of these aren't worth fixing, they can be moved out of the "todo" block
Btw, one can ignore a rule for a line if you want to intentionally do something. see error suppression | Ruff docs
select = [ | ||
"D", # pydocstyle | ||
"E", # Error | ||
"F", # pyflakes | ||
"I", # isort | ||
"B", # Bugbear | ||
"UP", # pyupgrade | ||
"LOG", # logging | ||
"ICN", # import conventions | ||
"G", # logging-format | ||
"RUF", # ruff | ||
"ISC001", # single-line-implicit-string-concatenation | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core rule sets that are selected. More info in Ruff docs
Regarding the other projects, perhaps you can copy these config files across to them as needed @mvdh7 ? I think that might be a better way, and allow you to select rules etc as you see fit (rather than me opening many similar PRs) |
5d1e070
to
b6519d8
Compare
b6519d8
to
5c91e3c
Compare
Re. the PR, I have updated it so it just has the config files. So, when you want to incorporate it, all you have to do is:
|
This PR adds dependabot, pre-commit and ruff configuration to the codebase. These files (ie,
.github/dependabot.yml
,.pre-commit-config.yaml
andpyproject.toml
) are the only places where manual changes have been made, all other changes in this PR are as a result of the included tools.Let me knwo @mvdh7 if there are any tools/linting rules that you are unsure of