3 Matching Annotations
- Jul 2023
-
pythonspeed.com pythonspeed.com
-
For a new project, I’d just immediately start with Ruff; for existing projects, I would strongly recommend trying it as soon as you start getting annoyed about how long linting is taking in CI (or even worse, on your computer).
Recommendation for when to use Ruff over PyLint or Flake8
Tags
Annotators
URL
-
- Jul 2021
-
mitelman.engineering mitelman.engineering
-
Pylint is a very strict and nit-picky linter. Google uses it for their Python projects internally according to their guidelines. Because of it’s nature, you’ll probably spend a lot of time fighting or configuring it. Which is maybe not bad, by the way. Outcome of such strictness can be a safer code, however, as a consequence - longer development time.
Pylint is a very strict linter embraced by Google
-
The goal of this tutorial is to describe Python development ecosystem.
tl;dr:
INSTALLATION:
- Install Python through pyenv (don't use python.org)
- Install dependencies with Poetry (miniconda3 is also fine for some cases)
TESTING:
- Write tests with pytest (default testing framework for Poetry)
- Check test coverage with pytest-cov plugin
- Use pre-commit for automatic checks before git commiting (for example, for automatic code refactoring)
REFACTORING:
- Lint your code with flake8 to easily find bugs (it is not as strict as pylint)
- Format your code with Black so that it looks the same in every project (is consistent)
- Sort imports with isort (so that they are nicely organised: standard library, third party, local)
-