Rule — Code Quality — All code quality linters should be installed in the current environment

In order for mllint to be able to run the recommended code quality linters, they must be installed in the current environment, i.e. they must be on PATH. This can be done in a variety of ways, such as installing them globally and / or appending to PATH, but a more recommended way is to install them into a virtualenv, then activating this virtual environment and running mllint within it. Poetry and Pipenv do this automatically, simply install them as development dependencies (--dev) and run e....

1 min · Bart van Oort (bvobart)

Rule — Code Quality — Bandit reports no issues with this project

Bandit is a tool designed to find common security issues in Python code. This rule checks whether Bandit finds any security issues in your project. For configuring Bandit’s settings, such as which directories to exclude and which rules to enable / disable, create a .banditfile at the root of your project. See Bandit’s documentation to learn more.

1 min · Bart van Oort (bvobart)

Rule — Code Quality — Black reports no issues with this project

Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters. This rule checks whether Black finds any files it would fix in your project.

1 min · Bart van Oort (bvobart)

Rule — Code Quality — isort is properly configured

isort can be configured using several configuration files, of which .isort.cfg and pyproject.toml are preferred, according to isort’s documentation. These are both recognised by mllint, although we recommend centralising tool configurations in your project’s pyproject.toml Since mllint also recommends using Black, you should configure isort to be compatible with Black. This is done by putting the following in your pyproject.toml [tool.isort] profile = "black" Links to isorts documentation: Supported Config Files Black Compatibility

1 min · Bart van Oort (bvobart)

Rule — Code Quality — isort reports no issues with this project

isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections and by type. It provides a command line utility, Python library and plugins for various editors to quickly sort all your imports. This rule checks whether isort finds any files it would fix in your project.

1 min · Bart van Oort (bvobart)

Rule — Code Quality — Mypy reports no issues with this project

Mypy is an optional static type checker for Python that aims to combine the benefits of dynamic (or “duck”) typing and static typing. Mypy combines the expressive power and convenience of Python with a powerful type system and compile-time type checking. This rule checks whether Mypy finds any type issues when running it on all Python files in this project. Per default, mllint is configured to make Mypy enforce static typing....

1 min · Bart van Oort (bvobart)

Rule — Code Quality — Project should use code quality linters

If you have ever seen your code get squiggly coloured underlining while you are writing it, then you’ll be familiar with linting. Linting (or ‘static code analysis’ as it is more formally called) is the process of parsing and analysing source code without running it, in an attempt to find common programming issues. Such issues include type errors and possible buggy operations (e.g. using an undefined variable, or accessing a non-existant field on an object), but can also show opportunities to rewrite and improve (refactor) your code (e....

2 min · Bart van Oort (bvobart)

Rule — Code Quality — Pylint is configured for this project

Pylint has a good default configuration, though there are likely to be rules that you may want to enable, disable or customise for your project. For example, you may want to configure your indentation width, your maximum line length, or configure which files to ignore while linting. Additionally, some IDEs have their own default configuration for these linters, which may only enable a subset of Pylint’s rules. For example, VS Code is known to do this....

1 min · Bart van Oort (bvobart)

Rule — Code Quality — Pylint reports no issues with this project

Pylint is a static analysis tool for finding generic programming errors. This rule checks whether Pylint returns any errors when running it on all Python files in this project. The score for this rule is determined as a function of the number of messages Pylint returns and the lines of Python code that your project has. In the ideal case, Pylint does not recognise any code smells in your project, in which case the score is 100%....

1 min · Bart van Oort (bvobart)

Rule — Continuous Integration — Project uses Continuous Integration (CI)

This rule checks if your project is using Continuous Integration (CI). To learn more about what CI is, does and entails, see the description of category ci Implementing CI requires picking a CI provider that will run the automated builds and tests. There are many CI providers available and you will have to make your own decision on which fits you best, but mllint currently recognises four CI providers, namely:...

1 min · Bart van Oort (bvobart)