ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Auto​PEP8

by wistful ALL

Automatically formats Python code to conform to the PEP 8 style guide using autopep8 and pep8 modules

Details

  • 2.3.0
    1.3.6
  • github.​com
  • github.​com
  • 4 years ago
  • 2 weeks ago
  • 12 years ago

Installs

  • Total 163K
  • Win 83K
  • Mac 40K
  • Linux 40K
Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13
Windows 4 14 12 9 5 5 4 10 8 5 8 10 9 9 6 9 7 4 6 7 12 17 8 9 1 7 5 5 5 5 11 9 6 10 11 20 9 13 10 4 7 7 6 12 5 7
Mac 3 5 3 2 2 4 1 3 6 1 4 1 3 3 3 7 3 5 3 7 4 2 3 2 1 2 4 5 5 2 5 5 2 3 6 1 4 3 2 1 1 2 5 3 2 1
Linux 3 2 1 4 2 5 3 0 6 2 4 1 1 4 0 3 2 8 2 1 2 6 3 3 5 3 1 0 1 3 5 1 2 2 4 1 0 2 2 4 2 2 2 2 1 1
0510152025Feb 27Feb 24Feb 21Feb 18Feb 15Feb 12Feb 9Feb 6Feb 3Jan 31Jan 28Jan 25Jan 22Jan 19Jan 16Jan 13Feb 27 Linux: 3 Mac: 3 Windows: 4Feb 26 Linux: 2 Mac: 5 Windows: 14Feb 25 Linux: 1 Mac: 3 Windows: 12Feb 24 Linux: 4 Mac: 2 Windows: 9Feb 23 Linux: 2 Mac: 2 Windows: 5Feb 22 Linux: 5 Mac: 4 Windows: 5Feb 21 Linux: 3 Mac: 1 Windows: 4Feb 20 Linux: 0 Mac: 3 Windows: 10Feb 19 Linux: 6 Mac: 6 Windows: 8Feb 18 Linux: 2 Mac: 1 Windows: 5Feb 17 Linux: 4 Mac: 4 Windows: 8Feb 16 Linux: 1 Mac: 1 Windows: 10Feb 15 Linux: 1 Mac: 3 Windows: 9Feb 14 Linux: 4 Mac: 3 Windows: 9Feb 13 Linux: 0 Mac: 3 Windows: 6Feb 12 Linux: 3 Mac: 7 Windows: 9Feb 11 Linux: 2 Mac: 3 Windows: 7Feb 10 Linux: 8 Mac: 5 Windows: 4Feb 9 Linux: 2 Mac: 3 Windows: 6Feb 8 Linux: 1 Mac: 7 Windows: 7Feb 7 Linux: 2 Mac: 4 Windows: 12Feb 6 Linux: 6 Mac: 2 Windows: 17Feb 5 Linux: 3 Mac: 3 Windows: 8Feb 4 Linux: 3 Mac: 2 Windows: 9Feb 3 Linux: 5 Mac: 1 Windows: 1Feb 2 Linux: 3 Mac: 2 Windows: 7Feb 1 Linux: 1 Mac: 4 Windows: 5Jan 31 Linux: 0 Mac: 5 Windows: 5Jan 30 Linux: 1 Mac: 5 Windows: 5Jan 29 Linux: 3 Mac: 2 Windows: 5Jan 28 Linux: 5 Mac: 5 Windows: 11Jan 27 Linux: 1 Mac: 5 Windows: 9Jan 26 Linux: 2 Mac: 2 Windows: 6Jan 25 Linux: 2 Mac: 3 Windows: 10Jan 24 Linux: 4 Mac: 6 Windows: 11Jan 23 Linux: 1 Mac: 1 Windows: 20Jan 22 Linux: 0 Mac: 4 Windows: 9Jan 21 Linux: 2 Mac: 3 Windows: 13Jan 20 Linux: 2 Mac: 2 Windows: 10Jan 19 Linux: 4 Mac: 1 Windows: 4Jan 18 Linux: 2 Mac: 1 Windows: 7Jan 17 Linux: 2 Mac: 2 Windows: 7Jan 16 Linux: 2 Mac: 5 Windows: 6Jan 15 Linux: 2 Mac: 3 Windows: 12Jan 14 Linux: 1 Mac: 2 Windows: 5Jan 13 Linux: 1 Mac: 1 Windows: 7Feb 27 Linux: 3 Mac: 3 Windows: 4Feb 26 Linux: 2 Mac: 5 Windows: 14Feb 25 Linux: 1 Mac: 3 Windows: 12Feb 24 Linux: 4 Mac: 2 Windows: 9Feb 23 Linux: 2 Mac: 2 Windows: 5Feb 22 Linux: 5 Mac: 4 Windows: 5Feb 21 Linux: 3 Mac: 1 Windows: 4Feb 20 Linux: 0 Mac: 3 Windows: 10Feb 19 Linux: 6 Mac: 6 Windows: 8Feb 18 Linux: 2 Mac: 1 Windows: 5Feb 17 Linux: 4 Mac: 4 Windows: 8Feb 16 Linux: 1 Mac: 1 Windows: 10Feb 15 Linux: 1 Mac: 3 Windows: 9Feb 14 Linux: 4 Mac: 3 Windows: 9Feb 13 Linux: 0 Mac: 3 Windows: 6Feb 12 Linux: 3 Mac: 7 Windows: 9Feb 11 Linux: 2 Mac: 3 Windows: 7Feb 10 Linux: 8 Mac: 5 Windows: 4Feb 9 Linux: 2 Mac: 3 Windows: 6Feb 8 Linux: 1 Mac: 7 Windows: 7Feb 7 Linux: 2 Mac: 4 Windows: 12Feb 6 Linux: 6 Mac: 2 Windows: 17Feb 5 Linux: 3 Mac: 3 Windows: 8Feb 4 Linux: 3 Mac: 2 Windows: 9Feb 3 Linux: 5 Mac: 1 Windows: 1Feb 2 Linux: 3 Mac: 2 Windows: 7Feb 1 Linux: 1 Mac: 4 Windows: 5Jan 31 Linux: 0 Mac: 5 Windows: 5Jan 30 Linux: 1 Mac: 5 Windows: 5Jan 29 Linux: 3 Mac: 2 Windows: 5Jan 28 Linux: 5 Mac: 5 Windows: 11Jan 27 Linux: 1 Mac: 5 Windows: 9Jan 26 Linux: 2 Mac: 2 Windows: 6Jan 25 Linux: 2 Mac: 3 Windows: 10Jan 24 Linux: 4 Mac: 6 Windows: 11Jan 23 Linux: 1 Mac: 1 Windows: 20Jan 22 Linux: 0 Mac: 4 Windows: 9Jan 21 Linux: 2 Mac: 3 Windows: 13Jan 20 Linux: 2 Mac: 2 Windows: 10Jan 19 Linux: 4 Mac: 1 Windows: 4Jan 18 Linux: 2 Mac: 1 Windows: 7Jan 17 Linux: 2 Mac: 2 Windows: 7Jan 16 Linux: 2 Mac: 5 Windows: 6Jan 15 Linux: 2 Mac: 3 Windows: 12Jan 14 Linux: 1 Mac: 2 Windows: 5Jan 13 Linux: 1 Mac: 1 Windows: 7Feb 27 Linux: 3 Mac: 3 Windows: 4Feb 26 Linux: 2 Mac: 5 Windows: 14Feb 25 Linux: 1 Mac: 3 Windows: 12Feb 24 Linux: 4 Mac: 2 Windows: 9Feb 23 Linux: 2 Mac: 2 Windows: 5Feb 22 Linux: 5 Mac: 4 Windows: 5Feb 21 Linux: 3 Mac: 1 Windows: 4Feb 20 Linux: 0 Mac: 3 Windows: 10Feb 19 Linux: 6 Mac: 6 Windows: 8Feb 18 Linux: 2 Mac: 1 Windows: 5Feb 17 Linux: 4 Mac: 4 Windows: 8Feb 16 Linux: 1 Mac: 1 Windows: 10Feb 15 Linux: 1 Mac: 3 Windows: 9Feb 14 Linux: 4 Mac: 3 Windows: 9Feb 13 Linux: 0 Mac: 3 Windows: 6Feb 12 Linux: 3 Mac: 7 Windows: 9Feb 11 Linux: 2 Mac: 3 Windows: 7Feb 10 Linux: 8 Mac: 5 Windows: 4Feb 9 Linux: 2 Mac: 3 Windows: 6Feb 8 Linux: 1 Mac: 7 Windows: 7Feb 7 Linux: 2 Mac: 4 Windows: 12Feb 6 Linux: 6 Mac: 2 Windows: 17Feb 5 Linux: 3 Mac: 3 Windows: 8Feb 4 Linux: 3 Mac: 2 Windows: 9Feb 3 Linux: 5 Mac: 1 Windows: 1Feb 2 Linux: 3 Mac: 2 Windows: 7Feb 1 Linux: 1 Mac: 4 Windows: 5Jan 31 Linux: 0 Mac: 5 Windows: 5Jan 30 Linux: 1 Mac: 5 Windows: 5Jan 29 Linux: 3 Mac: 2 Windows: 5Jan 28 Linux: 5 Mac: 5 Windows: 11Jan 27 Linux: 1 Mac: 5 Windows: 9Jan 26 Linux: 2 Mac: 2 Windows: 6Jan 25 Linux: 2 Mac: 3 Windows: 10Jan 24 Linux: 4 Mac: 6 Windows: 11Jan 23 Linux: 1 Mac: 1 Windows: 20Jan 22 Linux: 0 Mac: 4 Windows: 9Jan 21 Linux: 2 Mac: 3 Windows: 13Jan 20 Linux: 2 Mac: 2 Windows: 10Jan 19 Linux: 4 Mac: 1 Windows: 4Jan 18 Linux: 2 Mac: 1 Windows: 7Jan 17 Linux: 2 Mac: 2 Windows: 7Jan 16 Linux: 2 Mac: 5 Windows: 6Jan 15 Linux: 2 Mac: 3 Windows: 12Jan 14 Linux: 1 Mac: 2 Windows: 5Jan 13 Linux: 1 Mac: 1 Windows: 7

Readme

Source
raw.​githubusercontent.​com

Sublime Auto PEP8 Formatting

Note: project is no longer supported.

About

Automatically formats Python code to conform to the PEP 8 style guide using autopep8 library.

Supports ST3 only.

Note: The walrus(if thing := foo.bar.baz: pass) operator is not supported. Auto-formatting is running by SublimeText python interpreter, which is locked to version 3.3, and walrus operator is supporter starting python3.8.

Features

  • format / preview code according PEP8
  • format / preview selected text
  • format / preview all python modules in folder
  • side bar menu
  • format code while saving

Installing

The easiest way to install AutoPEP8 in through Package Control, which can be found at this site: http://wbond.net/sublime_packages/package_control.

Once you install Package Control, restart ST3 and bring up the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows). Select “Package Control: Install Package”, wait while Package Control fetches the latest package list, then select AutoPEP8 when the list appears.

Pep8(pycodestyle) configuration

The extenstion supports both --global-config and --ignore-local-config options from the autopep8.

Settings

{

    "max-line-length": 79,

    // Do not fix these errors / warnings(e.g. E4, W)
    "ignore": "",

    // Select errors / warnings(e.g. E4, W)
    "select": "",

    // Number of spaces per indent level
    "indent-size": 4,

    // Don't look for and apply local config files;
    // if false, defaults are updated with any config files in the project's root directory.
    "ignore-local-config": false,

    // Path to a global pep8 config file;
    // if this file doesnot exist then this is ignored.
    "global-config": "",

    // Hang closing bracket instead of matching indentation of opening bracket's line.
    "hang-closing": false,

    // Specifies whether or not format files once they saved.
    "format_on_save": false,

    // If true - open new output panel with format/preview results.
    "show_output_panel": true,

    // Format/Preview menu items only appear for views
    // with syntax from `syntax_list`
    // value is base filename of the .tmLanguage syntax files
    "syntax_list": ["Python"],

    // The value shows how deep the plugin should look for *.py files
    // before disabling "Preview" and "Format" items in the Side Bar "AutoPep8" Context Menu.
    "file_menu_search_depth": 3, // max depth to search python files

    // If value is false(default)
    // then formatter doesn't treat absence of bottom empty line as an error
    // and doesn't try to fix it.
    "avoid_new_line_in_select_mode": false,

    // For debug purporse only.
    "debug": false,
    "logfile": "/tmp/sublimeautopep8.log"  // File to store debug messages.
}

Using

  • SideBar - right click on the file(s) or folder(s)
  • Active view - right click on the view
  • Selected text - right click on the selected text
  • On Save - provide by settings: option format_on_save
  • Command Palette - bring up the Command Palette and select PEP8: Format Code or PEP8: Preview Changes
  • Hotkeys - Command/Control + Shift + 8 to format code, Command/Control + 8 to preview changes