Git Product home page Git Product logo

pep8ify's Introduction

Pep8ify: Clean your code with ease

https://secure.travis-ci.org/spulec/pep8ify.png?branch=master

Pep8ify is a library that modifies python source code to conform to pep8.

Installation

This library currently only works with python 2.7

To install pep8ify, simply:

$ pip install pep8ify

Usage

To print a diff of changes that pep8ify will make against a particular source file or directory:

$ pep8ify source_folder

To have those changes written to the files:

$ pep8ify -w source_folder

By default, this will create backup files for each file that will be changed. You can add the -n option to not create the backups. Please do not do this if you are not using a version control system. Although this code is well-tested, there are most likely bugs still.

For more options about running particular fixers, read the lib2to3 documentation. This library is built on top of that one.

Fixes

A list of the available fixers can be found with the following:

$ pep8ify -l
Available transformations for the -f/--fix option:
blank_lines
compound_statements
extraneous_whitespace
imports_on_separate_lines
indentation
maximum_line_length
missing_newline
missing_whitespace
tabs
trailing_blank_lines
trailing_whitespace
whitespace_around_operator
whitespace_before_inline_comment
whitespace_before_parameters

All of these are set to run by default except for 'maximum_line_length'. To run all fixes including 'maximum_line_length', run:

$ pep8ify -f all -f maximum_line_length example.py

pep8ify's People

Contributors

spulec avatar zmsmith avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.