Fiasko Bro

https://travis-ci.org/devmanorg/fiasko_bro.svg?branch=master https://codecov.io/gh/devmanorg/fiasko_bro/branch/master/graph/badge.svg https://readthedocs.org/projects/fiasko-bro/badge/?version=latest

Fiasko is a static analysis tool for Python code that catches common style errors.

It enables you to comprehensively analyze Python projects by looking not only at the Python code, but also commit messages, file encodings, non-Python files, etc.

Installation

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

Usage

Fiasko was conceived as a tool used through Python interface. Here’s the simplest usage example:

>>> 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_multiple_of_tab_size', 'ast_helpers.py:130'), ('variables_that_shadow_default_names', '_, slice')]

Then CLI was added:

$ 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

In this example, the folder ~/projects/fiasko_bro contains a git repository which allowed Fiasko to find a questionable commit message “add files via upload”.

Tests

python -m pytest

Versioning

We follow semantic versioning.