Skip to content

Timonzel/fiasko_bro

Repository files navigation

Fiasko Bro

When flake8 is not enough.
Build Status codecov Documentation Status Maintainability PyPI version

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

http://melevir.com/static/fiasko.jpg

Example

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.

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

Docs

fiasko-bro.readthedocs.io

Contributing

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.

Launch tests

python -m pytest

Versioning

We follow semantic versioning.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages