When flake8 is not enough.
Fiasko is a static analysis tool for Python code that catches common style errors.
From command line:
$ fiasko -p ~/projects/fiasko_bro
commit_messages_from_blacklist add files via upload
too_many_pep8_violations 33 PEP8 violations
too_difficult_by_mccabe has_changed_readme
star_import __init__.py
local_import setup.py
has_variables_from_blacklist name, n
short_variable_name i, r, n, t, l
file_too_long ast_helpers.py
too_nested code_validator.py:54
indent_not_multiple_of_tab_size ast_helpers.py:130
variables_that_shadow_default_names slice
==================================================
Total 11 violations
See fiasko --help
for more CLI arguments.
From Python code:
>>> from fiasko_bro import validate
>>> validate('/user/projects/fiasko_bro/')
[('commit_messages_from_blacklist', 'add files via upload'), ('too_many_pep8_violations', '33 PEP8 violations'), ('too_difficult_by_mccabe', 'has_changed_readme'), ('star_import', '__init__.py'), ('local_import', 'setup.py'), ('has_variables_from_blacklist', 'name, n'), ('short_variable_name', 'n, r, l, t, i'), ('file_too_long', 'ast_helpers.py'), ('too_nested', 'code_validator.py:54'), ('indent_not_four_spaces', 'ast_helpers.py:130'), ('variables_that_shadow_default_names', '_, slice')]
The validate
method returns list of tuples which consist of an error slug and an error message.
Fiasko has a flexible Python API which you can read more about in the docs.
With pip:
pip install fiasko_bro
With Pipenv:
pipenv install fiasko_bro
Or just clone the project and install the requirements:
$ git clone https://github.com/devmanorg/fiasko_bro.git
$ cd fiasko_bro
$ pip install -r requirements.txt
To contribute, pick an issue to work on and leave a comment saying that you've taken the issue. Don't forget to mention when you want to submit the pull request.
You can read more about contribution guidelines in the docs
If your suggestion (or bug report) is new, be sure to create an issue first.
python -m pytest
We follow semantic versioning.