MLSmellHound is a tool that provides context-aware linting. It is based on Pylint, a popular linter for Python projects that is highly configurable but that does not consider context.
- Bash
- Python3
- Pip3
Currently, the only other dependency is Pylint 2.11.1:
pip3 install -r requirements.txt
To lint all Python files in example-src
(edit mlsh
Bash script to run on your own project):
./mlsh
The script will analyse all Python files in the project directory then write the audit report to outputs/<datetime>/lint-context.txt
To compare the results to the default Pylint output:
pylint example-src > pylint-default-output.txt
diff pylint-default-output.txt outputs/<datetime>/lint-context.txt
The above screenshot shows the difference between Pylint default output (left), and transformed ouput generated by MLSmellHound (right). Pylint warns about “e” and “df”, whereas MLSmellHound accepts these in the context of ML files. The output also shows that trailing-whitespace warnings have been re-ranked to a lower priority for ML files.