IMPORTANT: This repository is not being maintained anymore.
danger-pep8
Find PEP 8 issues in python files.
Installation
Via global gems
$ gem install danger-pep8
Via Bundler
Add the following line to your Gemfile and then run bundle install
:
gem 'danger-pep8'
Usage
Basic
Check for issues running the script from current directory. Prints a markdown table with all issues found:
pep8.lint
Advanced
Running from a custom directory
Changes root folder from where script is running:
pep8.base_dir = "src"
pep8.lint
Use GitHub's inline comments instead of a markdown table
pep8.lint(use_inline_comments=true)
Running using a configuration file different than the usual
If you need to specify a different configuration file, use the config_file
parameter below. Check this link for more information about Configuration Locations.
pep8.config_file = ".flake8_ci"
pep8.lint
Printing a warning message with number of errors
Adds an entry onto the warnings/failures table:
pep8.count_errors
Defining a threshold of max errors
Warns if number of issues is greater than a given threshold:
pep8.threshold = 10
pep8.count_errors
Fails if number of issues is greater than a given threshold:
pep8.threshold = 10
pep8.count_errors(should_fail = true)
Development
- Clone this repo
- Run
bundle install
to setup dependencies. - Run
bundle exec rake spec
to run the tests. - Use
bundle exec guard
to automatically have tests run as you make changes. - Make your changes.
License
MIT