Question:
What tools have you used to track and maintain code cleanliness?
How often asked: Often
Suggested by: ALittleMoron
Answer:
I have experience using static analyzers — pyright, mypy, and recently tried ty. I also frequently use linters in my work — primarily ruff, but I also have experience with flake8, autopep8, and pylint. I also use code formatters — also primarily ruff, but I also have experience with black. I also actively use import sorting tools — isort, ruff.
In general, I try to use all available quality gate utilities to write the cleanest and most understandable code possible.
Interview answer explanation:
Essentially, answering this question requires a complete understanding of all the Quality Gate utilities available in Python.
It would be a big plus if you could name all of them, including the most popular ones. It would also be a plus if you could name alternatives, as different projects at different companies use different utilities. Some projects might use ruff solely as a linter, while others might use it fully, including a linter, sorter, and formatter.
Furthermore, this question is important because it's rare these days to find a project without all of these tools.
External resources:
- Building a Robust CI Quality Gate: Enforcing Code Quality with flake8, mypy, pytest, and Coverage Checks
A good explanation of why quality gates are needed in general, with examples.