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
  • 1 hour ago
  • 13 years ago

Installs

  • Total 164K
  • Win 84K
  • Mac 40K
  • Linux 40K
May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7
Windows 2 8 6 3 11 5 3 5 8 6 13 3 5 9 7 6 5 6 3 2 1 6 12 11 8 8 5 12 8 7 8 2 4 4 4 5 7 10 9 5 5 6 9 8 13 4
Mac 1 3 1 4 0 1 3 3 5 2 1 1 0 3 4 4 0 4 1 2 1 0 1 1 3 4 3 1 3 5 5 5 0 3 2 4 0 7 3 0 2 2 3 6 3 5
Linux 1 1 4 5 5 2 3 3 3 2 1 2 3 1 1 9 0 4 6 3 1 2 6 4 1 1 1 3 1 3 2 3 0 3 8 2 5 0 5 4 3 2 4 2 3 3
051015May 22May 19May 16May 13May 10May 7May 4May 1Apr 28Apr 25Apr 22Apr 19Apr 16Apr 13Apr 10Apr 7May 22 Linux: 1 Mac: 1 Windows: 2May 21 Linux: 1 Mac: 3 Windows: 8May 20 Linux: 4 Mac: 1 Windows: 6May 19 Linux: 5 Mac: 4 Windows: 3May 18 Linux: 5 Mac: 0 Windows: 11May 17 Linux: 2 Mac: 1 Windows: 5May 16 Linux: 3 Mac: 3 Windows: 3May 15 Linux: 3 Mac: 3 Windows: 5May 14 Linux: 3 Mac: 5 Windows: 8May 13 Linux: 2 Mac: 2 Windows: 6May 12 Linux: 1 Mac: 1 Windows: 13May 11 Linux: 2 Mac: 1 Windows: 3May 10 Linux: 3 Mac: 0 Windows: 5May 9 Linux: 1 Mac: 3 Windows: 9May 8 Linux: 1 Mac: 4 Windows: 7May 7 Linux: 9 Mac: 4 Windows: 6May 6 Linux: 0 Mac: 0 Windows: 5May 5 Linux: 4 Mac: 4 Windows: 6May 4 Linux: 6 Mac: 1 Windows: 3May 3 Linux: 3 Mac: 2 Windows: 2May 2 Linux: 1 Mac: 1 Windows: 1May 1 Linux: 2 Mac: 0 Windows: 6Apr 30 Linux: 6 Mac: 1 Windows: 12Apr 29 Linux: 4 Mac: 1 Windows: 11Apr 28 Linux: 1 Mac: 3 Windows: 8Apr 27 Linux: 1 Mac: 4 Windows: 8Apr 26 Linux: 1 Mac: 3 Windows: 5Apr 25 Linux: 3 Mac: 1 Windows: 12Apr 24 Linux: 1 Mac: 3 Windows: 8Apr 23 Linux: 3 Mac: 5 Windows: 7Apr 22 Linux: 2 Mac: 5 Windows: 8Apr 21 Linux: 3 Mac: 5 Windows: 2Apr 20 Linux: 0 Mac: 0 Windows: 4Apr 19 Linux: 3 Mac: 3 Windows: 4Apr 18 Linux: 8 Mac: 2 Windows: 4Apr 17 Linux: 2 Mac: 4 Windows: 5Apr 16 Linux: 5 Mac: 0 Windows: 7Apr 15 Linux: 0 Mac: 7 Windows: 10Apr 14 Linux: 5 Mac: 3 Windows: 9Apr 13 Linux: 4 Mac: 0 Windows: 5Apr 12 Linux: 3 Mac: 2 Windows: 5Apr 11 Linux: 2 Mac: 2 Windows: 6Apr 10 Linux: 4 Mac: 3 Windows: 9Apr 9 Linux: 2 Mac: 6 Windows: 8Apr 8 Linux: 3 Mac: 3 Windows: 13Apr 7 Linux: 3 Mac: 5 Windows: 4May 22 Linux: 1 Mac: 1 Windows: 2May 21 Linux: 1 Mac: 3 Windows: 8May 20 Linux: 4 Mac: 1 Windows: 6May 19 Linux: 5 Mac: 4 Windows: 3May 18 Linux: 5 Mac: 0 Windows: 11May 17 Linux: 2 Mac: 1 Windows: 5May 16 Linux: 3 Mac: 3 Windows: 3May 15 Linux: 3 Mac: 3 Windows: 5May 14 Linux: 3 Mac: 5 Windows: 8May 13 Linux: 2 Mac: 2 Windows: 6May 12 Linux: 1 Mac: 1 Windows: 13May 11 Linux: 2 Mac: 1 Windows: 3May 10 Linux: 3 Mac: 0 Windows: 5May 9 Linux: 1 Mac: 3 Windows: 9May 8 Linux: 1 Mac: 4 Windows: 7May 7 Linux: 9 Mac: 4 Windows: 6May 6 Linux: 0 Mac: 0 Windows: 5May 5 Linux: 4 Mac: 4 Windows: 6May 4 Linux: 6 Mac: 1 Windows: 3May 3 Linux: 3 Mac: 2 Windows: 2May 2 Linux: 1 Mac: 1 Windows: 1May 1 Linux: 2 Mac: 0 Windows: 6Apr 30 Linux: 6 Mac: 1 Windows: 12Apr 29 Linux: 4 Mac: 1 Windows: 11Apr 28 Linux: 1 Mac: 3 Windows: 8Apr 27 Linux: 1 Mac: 4 Windows: 8Apr 26 Linux: 1 Mac: 3 Windows: 5Apr 25 Linux: 3 Mac: 1 Windows: 12Apr 24 Linux: 1 Mac: 3 Windows: 8Apr 23 Linux: 3 Mac: 5 Windows: 7Apr 22 Linux: 2 Mac: 5 Windows: 8Apr 21 Linux: 3 Mac: 5 Windows: 2Apr 20 Linux: 0 Mac: 0 Windows: 4Apr 19 Linux: 3 Mac: 3 Windows: 4Apr 18 Linux: 8 Mac: 2 Windows: 4Apr 17 Linux: 2 Mac: 4 Windows: 5Apr 16 Linux: 5 Mac: 0 Windows: 7Apr 15 Linux: 0 Mac: 7 Windows: 10Apr 14 Linux: 5 Mac: 3 Windows: 9Apr 13 Linux: 4 Mac: 0 Windows: 5Apr 12 Linux: 3 Mac: 2 Windows: 5Apr 11 Linux: 2 Mac: 2 Windows: 6Apr 10 Linux: 4 Mac: 3 Windows: 9Apr 9 Linux: 2 Mac: 6 Windows: 8Apr 8 Linux: 3 Mac: 3 Windows: 13Apr 7 Linux: 3 Mac: 5 Windows: 4May 22 Linux: 1 Mac: 1 Windows: 2May 21 Linux: 1 Mac: 3 Windows: 8May 20 Linux: 4 Mac: 1 Windows: 6May 19 Linux: 5 Mac: 4 Windows: 3May 18 Linux: 5 Mac: 0 Windows: 11May 17 Linux: 2 Mac: 1 Windows: 5May 16 Linux: 3 Mac: 3 Windows: 3May 15 Linux: 3 Mac: 3 Windows: 5May 14 Linux: 3 Mac: 5 Windows: 8May 13 Linux: 2 Mac: 2 Windows: 6May 12 Linux: 1 Mac: 1 Windows: 13May 11 Linux: 2 Mac: 1 Windows: 3May 10 Linux: 3 Mac: 0 Windows: 5May 9 Linux: 1 Mac: 3 Windows: 9May 8 Linux: 1 Mac: 4 Windows: 7May 7 Linux: 9 Mac: 4 Windows: 6May 6 Linux: 0 Mac: 0 Windows: 5May 5 Linux: 4 Mac: 4 Windows: 6May 4 Linux: 6 Mac: 1 Windows: 3May 3 Linux: 3 Mac: 2 Windows: 2May 2 Linux: 1 Mac: 1 Windows: 1May 1 Linux: 2 Mac: 0 Windows: 6Apr 30 Linux: 6 Mac: 1 Windows: 12Apr 29 Linux: 4 Mac: 1 Windows: 11Apr 28 Linux: 1 Mac: 3 Windows: 8Apr 27 Linux: 1 Mac: 4 Windows: 8Apr 26 Linux: 1 Mac: 3 Windows: 5Apr 25 Linux: 3 Mac: 1 Windows: 12Apr 24 Linux: 1 Mac: 3 Windows: 8Apr 23 Linux: 3 Mac: 5 Windows: 7Apr 22 Linux: 2 Mac: 5 Windows: 8Apr 21 Linux: 3 Mac: 5 Windows: 2Apr 20 Linux: 0 Mac: 0 Windows: 4Apr 19 Linux: 3 Mac: 3 Windows: 4Apr 18 Linux: 8 Mac: 2 Windows: 4Apr 17 Linux: 2 Mac: 4 Windows: 5Apr 16 Linux: 5 Mac: 0 Windows: 7Apr 15 Linux: 0 Mac: 7 Windows: 10Apr 14 Linux: 5 Mac: 3 Windows: 9Apr 13 Linux: 4 Mac: 0 Windows: 5Apr 12 Linux: 3 Mac: 2 Windows: 5Apr 11 Linux: 2 Mac: 2 Windows: 6Apr 10 Linux: 4 Mac: 3 Windows: 9Apr 9 Linux: 2 Mac: 6 Windows: 8Apr 8 Linux: 3 Mac: 3 Windows: 13Apr 7 Linux: 3 Mac: 5 Windows: 4

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