Category — Testing

Testing in the context of Software Engineering refers to the practice of writing automated checks to ensure that something works as intended. Testing ML systems is, however, different from testing traditional software systems. In traditional software systems, humans write all the logic that processes whatever data the system handles, whereas in ML systems, humans provide examples (training data) of what we want the desired behaviour to be and the machine learns the logic required to produce this behaviour....

2 min · Bart van Oort (bvobart)

Category — Version Control

This category contains rules relating to version controlling the code and data. Version control software allows you to track changes to your project and helps to work collaboratively with other people within the same project. It also allows you to easily return to an earlier version of your project or merge two versions together. Git is the ubiquitously used tool for version controlling code, but Git is not very efficient at handling large or binary files....

1 min · Bart van Oort (bvobart)

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)