Code Quality: Additional lints in this repository (help wanted!)
See original GitHub issueWe’re doing a bunch of code quality cleanup, and as part of that effort I’d like to implement some additional lints/coding conventions. There will be a lot of manual changes here, so I think these will be some items to have multiple people tackle.
In no particular order:
- ~Add
ban-relative-imports = true
to.flake8
and remove relative imports from the repo.~ - ~Add
flake8-type-checking==1.0.4
to.pre-commit-config.yaml
withenable-extensions = TC, TC2
in.flake8
, and rework our type annotations for zero runtime cost using string constants. When we drop Python 3.6 support, pyupgrade will be used to automatically switch tofrom __future__ import annotations
and unquote the annotations.~ - ~Add
flake8-use-fstring==1.3
to.pre-commit-config.yaml
and fix all the use of.format()
on string constants in the repo. Start at level 0, and try level 1 if possible. Level 2 is likely useless in this repo (I think we will always use.format()
on string variables), but you could prove me wrong.~ - ~Remove
E501
from.flake8
– currently, black leaves our long comments, docstrings, and string constants alone – let’s hand-format them to comply with the line length limit.~
Please call dibs in this issue to prevent duplicated effort.
(suggestions for additional code quality improvements/tools to enforce them are also welcomed here)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:27 (25 by maintainers)
Top Results From Across the Web
Code Quality - GitLab Docs
To ensure your project's code stays simple, readable, and easy to contribute to, you can use GitLab CI/CD to analyze your source code...
Read more >Super-Linter · Actions · GitHub Marketplace
ENV VAR Default Value Notes
DEFAULT_BRANCH master The name of the repository default branch.
EDITORCONFIG_FILE_NAME.ecrc Filename for editorconfig‑checker configuration
JSCPD_CONFIG_FILE.jscpd.json Filename for JSCPD configuration
Read more >Commit Message Lint — Improve the Code Commit Quality
It enables you to perform linting checks, static code analysis, ... Central installation into the repository, providing more control.
Read more >How to Use GitHub Super Linter in Your Projects
Linting is essentially a form of static code analysis. It analyzes the code you wrote against some rules for stylistic or programmatic errors....
Read more >Automatically format and lint code with pre-commit - Interrupt
How to use pre-commit for automated linting, formatting, and styling firmware code by using Python, clang-format, clang-tidy, and prettier.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I learned about nitpick these days. I wonder if we like to use it, to enforce a minimum set of checks across our repos?
I find quite a lot to like in flake8-pie.
Not sure I agree with absolutely everything it warns about, but you can always disable the things that you don’t want.
(I don’t plan to work on adding this to the repository, if anyone wants to have a go then we will not be duplicating one another.)