From b6c3d7dad3f7449a889a496ff1dfe5212249102a Mon Sep 17 00:00:00 2001 From: guyskk Date: Sun, 6 Nov 2016 14:56:46 +0000 Subject: [PATCH 1/3] fix #585: Add option to disable the loading notification --- src/beautify.coffee | 7 ++++--- src/config.coffee | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/beautify.coffee b/src/beautify.coffee index c188d20..0a6afd6 100644 --- a/src/beautify.coffee +++ b/src/beautify.coffee @@ -56,9 +56,10 @@ setCursors = (editor, posArray) -> # Show beautification progress/loading view beautifier.on('beautify::start', -> - LoadingView ?= require "./views/loading-view" - loadingView ?= new LoadingView() - loadingView.show() + if atom.config.get("atom-beautify.general.showLoadingView") + LoadingView ?= require "./views/loading-view" + loadingView ?= new LoadingView() + loadingView.show() ) beautifier.on('beautify::end', -> loadingView?.hide() diff --git a/src/config.coffee b/src/config.coffee index 6d3a80d..5c6ceaf 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -42,4 +42,9 @@ module.exports = { type : 'boolean' default : false description : "Do not show any/all errors when they occur" + showLoadingView : + title: "Show Loading View" + type : 'boolean' + default : true + description : "Show loading view when beautifying" } From d85bd22bcb4bd19e9ebd81b20a9cf9084586fc78 Mon Sep 17 00:00:00 2001 From: guyskk Date: Sun, 20 Nov 2016 09:23:36 +0000 Subject: [PATCH 2/3] add pybeautifier --- package.json | 5 +++ src/beautifiers/index.coffee | 1 + src/beautifiers/pybeautifier.coffee | 66 +++++++++++++++++++++++++++++ src/languages/python.coffee | 23 +++++++++- 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 src/beautifiers/pybeautifier.coffee diff --git a/package.json b/package.json index 497e15c..95ceb9f 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,10 @@ { "name": "Victor Uriarte", "url": "https://github.com/vmuriart" + }, + { + "name": "guyskk", + "url": "https://github.com/guyskk" } ], "engines": { @@ -288,6 +292,7 @@ "clojure beautifier", "nunjucks", "ux markup", + "pybeautifier", "cljfmt" ], "devDependencies": { diff --git a/src/beautifiers/index.coffee b/src/beautifiers/index.coffee index 704ed86..6e1a5c2 100644 --- a/src/beautifiers/index.coffee +++ b/src/beautifiers/index.coffee @@ -57,6 +57,7 @@ module.exports = class Beautifiers extends EventEmitter 'php-cs-fixer' 'phpcbf' 'prettydiff' + 'pybeautifier' 'pug-beautify' 'puppet-fix' 'remark' diff --git a/src/beautifiers/pybeautifier.coffee b/src/beautifiers/pybeautifier.coffee new file mode 100644 index 0000000..692a8fb --- /dev/null +++ b/src/beautifiers/pybeautifier.coffee @@ -0,0 +1,66 @@ +'use strict' +net = require('net') +Beautifier = require('./beautifier') + +HOST = '127.0.0.1' +PORT = 36805 +MULTI_LINE_OUTPUT_TABLE = { + 'Grid': 0, + 'Vertical': 1, + 'Hanging Indent': 2, + 'Vertical Hanging Indent': 3, + 'Hanging Grid': 4, + 'Hanging Grid Grouped': 5, + 'NOQA': 6 +} + +format = (data, formaters) -> + return new Promise (resolve, reject) -> + client = new net.Socket() + client.on 'error', (error) -> + client.destroy() + reject(error) + client.connect PORT, HOST, -> + client.setEncoding('utf8') + client.write(JSON.stringify({'data': data, 'formaters': formaters})) + response = '' + client.on 'data', (chunk) -> + response += chunk + client.on 'end', -> + response = JSON.parse(response) + if response.error? + reject(Error(response.error)) + else + resolve(response.data) + client.destroy() + +module.exports = class PythonBeautifier extends Beautifier + + name: "pybeautifier" + link: "https://github.com/guyskk/pybeautifier" + + options: { + Python: true + } + + beautify: (text, language, options) -> + formater = {'name': options.formater} + if options.formater == 'autopep8' + formater.config = { + 'ignore': options.ignore + 'max_line_length': options.max_line_length + } + else if options.formater == 'yapf' + formater.config = {'style_config': options.style_config} + formaters = [formater] + if options.sort_imports + multi_line_output = MULTI_LINE_OUTPUT_TABLE[options.multi_line_output] + formaters.push + 'name': 'isort' + 'config': {'multi_line_output': multi_line_output} + return new @Promise (resolve, reject) -> + format(text, formaters) + .then (data) -> + resolve(data) + .catch (error) -> + reject(error) diff --git a/src/languages/python.coffee b/src/languages/python.coffee index f598815..d62e0f5 100644 --- a/src/languages/python.coffee +++ b/src/languages/python.coffee @@ -41,9 +41,30 @@ module.exports = { items: type: 'string' description: "do not fix these errors/warnings" + formater: + type: 'string' + default: 'autopep8' + enum: ['autopep8', 'yapf'] + description: "formater used by pybeautifier" + style_config: + type: 'string' + default: 'pep8' + description: "formatting style used by yapf" sort_imports: type: 'boolean' default: false description: "sort imports (requires isort installed)" - + multi_line_output: + type: 'string' + default: 'Hanging Grid Grouped' + enum: [ + 'Grid' + 'Vertical' + 'Hanging Indent' + 'Vertical Hanging Indent' + 'Hanging Grid' + 'Hanging Grid Grouped' + 'NOQA' + ] + description: "defines how from imports wrap (requires isort installed)" } From 4a660f9e5a20b8b63c8d9a30f97269afc3d065e9 Mon Sep 17 00:00:00 2001 From: guyskk Date: Sun, 20 Nov 2016 09:24:36 +0000 Subject: [PATCH 3/3] update document via npm run docs --- README.md | 32 ++-- docs/options.md | 410 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 399 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 4a159f4..fc74dec 100644 --- a/README.md +++ b/README.md @@ -46,18 +46,18 @@ Or Settings/Preferences ➔ Packages ➔ Search for `atom-beautify` By default `Anonymous Analytics` is enabled. If you do not wish to have usage data sent to Google Analytics then please disable `Anonymous Analytics` option before using Atom-Beautify. -See [`Anonymous Analytics` section of docs](https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#anonymous-analytics) for details. +See [`Anonymous Analytics` section of docs](docs/options.md#anonymous-analytics) for details. Thank you. ### Next Version: [Unibeautify](https://github.com/Unibeautify/unibeautify) Atom-Beautify is going to be completely rewritten with [Unibeautify](https://github.com/Unibeautify/unibeautify) at its core! -See [`unibeautify` branch](https://github.com/Glavin001/atom-beautify/tree/unibeautify) for work in progress and [Issue #1174](https://github.com/Glavin001/atom-beautify/issues/1174). +See [`unibeautify` branch](../../tree/unibeautify) for work in progress and [Issue #1174](https://github.com/Glavin001/atom-beautify/issues/1174). ## Language Support -See [all supported options in the documentation at `docs/options.md`](https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md). +See [all supported options in the documentation at `docs/options.md`](docs/options.md). | Language | Grammars | File Extensions | Supported Beautifiers | | --- | --- | --- | ---- | @@ -99,9 +99,9 @@ See [all supported options in the documentation at `docs/options.md`](https://g | OCaml | `OCaml` |`.ml` | [`ocp-indent`](https://www.typerex.org/ocp-indent.html) (Default) | | Pawn | `Pawn` | | [`Uncrustify`](https://github.com/uncrustify/uncrustify) (Default) | | Perl | `Perl`, `Perl 6` |`.pl` | [`Perltidy`](http://perltidy.sourceforge.net/) (Default) | -| PHP | `PHP` |`.php`, `.module`, `.inc` | [`PHP-CS-Fixer`](http://php.net/manual/en/install.php) (Default), [`PHPCBF`](http://php.net/manual/en/install.php) | +| PHP | `PHP` |`.php`, `.module`, `.inc` | [`PHP-CS-Fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) (Default), [`PHPCBF`](http://php.net/manual/en/install.php) | | Puppet | `Puppet` |`.pp` | [`puppet-lint`](http://puppet-lint.com/) (Default) | -| Python | `Python` |`.py` | [`autopep8`](https://github.com/hhatto/autopep8) (Default), [`yapf`](https://github.com/google/yapf) | +| Python | `Python` |`.py` | [`autopep8`](https://github.com/hhatto/autopep8) (Default), [`pybeautifier`](https://github.com/guyskk/pybeautifier), [`yapf`](https://github.com/google/yapf) | | R | `R` |`.r`, `.R` | [`formatR`](https://github.com/yihui/formatR) (Default) | | Riot.js | `Riot.js`, `HTML (Riot Tag)` |`.tag` | [`Pretty Diff`](https://github.com/prettydiff/prettydiff) (Default) | | Ruby | `Ruby`, `Ruby on Rails` |`.rb` | [`Rubocop`](https://github.com/bbatsov/rubocop) (Default), [`Ruby Beautify`](https://github.com/erniebrodeur/ruby-beautify) | @@ -165,22 +165,22 @@ For example: Edit your `.jsbeautifyrc` file in any of the following locations: -- Atom Package Settings +- Atom Package Settings `Atom` ➔ `Preferences` ➔ Search for `atom-beautify` - Same directory as current file -- Project root +- Project root `atom-beautify` will recursively look up from the current file's directory to find `.jsbeautifyrc`. - Your user's home directory **Note**: *Comments are supported in `.jsbeautifyrc` thanks to [strip-json-comments](https://github.com/sindresorhus/strip-json-comments).* -See examples of both ways inside [`examples/`](https://github.com/donaldpipowitch/atom-beautify/tree/master/examples) +See examples of both ways inside [`examples/`](examples) -See [all supported options in the documentation at `docs/options.md`](https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md). +See [all supported options in the documentation at `docs/options.md`](docs/options.md). ### Simple -See [examples/simple-jsbeautifyrc/.jsbeautifyrc](https://github.com/donaldpipowitch/atom-beautify/blob/master/examples/simple-jsbeautifyrc/.jsbeautifyrc). +See [examples/simple-jsbeautifyrc/.jsbeautifyrc](examples/simple-jsbeautifyrc/.jsbeautifyrc). ```json { @@ -198,7 +198,7 @@ See [examples/simple-jsbeautifyrc/.jsbeautifyrc](https://github.com/donaldpipowi ### Nested (Recommended) -See [examples/nested-jsbeautifyrc/.jsbeautifyrc](https://github.com/donaldpipowitch/atom-beautify/blob/master/examples/nested-jsbeautifyrc/.jsbeautifyrc). +See [examples/nested-jsbeautifyrc/.jsbeautifyrc](examples/nested-jsbeautifyrc/.jsbeautifyrc). ```json { @@ -236,16 +236,16 @@ See [examples/nested-jsbeautifyrc/.jsbeautifyrc](https://github.com/donaldpipowi ## Troubleshooting -See [`docs/troubleshooting.md`](https://github.com/Glavin001/atom-beautify/blob/master/docs/troubleshooting.md). +See [`docs/troubleshooting.md`](docs/troubleshooting.md). ## Contributing -[See all contributors on GitHub](https://github.com/donaldpipowitch/atom-beautify/graphs/contributors). +[See all contributors on GitHub](../../graphs/contributors). -Please update the [CHANGELOG.md](https://github.com/donaldpipowitch/atom-beautify/blob/master/CHANGELOG.md), -add yourself as a contributor to the [package.json](https://github.com/donaldpipowitch/atom-beautify/blob/master/package.json), +Please update the [CHANGELOG.md](CHANGELOG.md), +add yourself as a contributor to the [package.json](package.json), and submit a [Pull Request on GitHub](https://help.github.com/articles/using-pull-requests/). ## License -[MIT](https://github.com/donaldpipowitch/atom-beautify/blob/master/LICENSE.md) © [Glavin Wiechert](https://github.com/Glavin001) +[MIT](LICENSE.md) © [Glavin Wiechert](https://github.com/Glavin001) diff --git a/docs/options.md b/docs/options.md index bcdd89e..d484f1d 100644 --- a/docs/options.md +++ b/docs/options.md @@ -8363,17 +8363,20 @@ Automatically beautify Puppet files on save #### [Python](#python) -**Supported Beautifiers**: [`autopep8`](#autopep8) [`yapf`](#yapf) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) [`yapf`](#yapf) -| Option | autopep8 | yapf | -| --- | --- | --- | -| `disabled` | :white_check_mark: | :white_check_mark: | -| `default_beautifier` | :white_check_mark: | :white_check_mark: | -| `beautify_on_save` | :white_check_mark: | :white_check_mark: | -| `ignore` | :white_check_mark: | :x: | -| `indent_size` | :white_check_mark: | :x: | -| `max_line_length` | :white_check_mark: | :x: | -| `sort_imports` | :white_check_mark: | :x: | +| Option | autopep8 | pybeautifier | yapf | +| --- | --- | --- | --- | +| `disabled` | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| `default_beautifier` | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| `beautify_on_save` | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| `formater` | :white_check_mark: | :white_check_mark: | :x: | +| `ignore` | :white_check_mark: | :white_check_mark: | :x: | +| `indent_size` | :white_check_mark: | :white_check_mark: | :x: | +| `max_line_length` | :white_check_mark: | :white_check_mark: | :x: | +| `multi_line_output` | :white_check_mark: | :white_check_mark: | :x: | +| `sort_imports` | :white_check_mark: | :white_check_mark: | :x: | +| `style_config` | :white_check_mark: | :white_check_mark: | :x: | **Description**: @@ -8404,7 +8407,7 @@ Disable Python Beautification **Type**: `string` -**Enum**: `autopep8` `yapf` +**Enum**: `autopep8` `pybeautifier` `yapf` **Description**: @@ -8434,6 +8437,34 @@ Automatically beautify Python files on save 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*Beautify On Save*" and change it to your desired configuration. +##### [Formater](#formater) + +**Namespace**: `python` + +**Key**: `formater` + +**Default**: `autopep8` + +**Type**: `string` + +**Enum**: `autopep8` `yapf` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +formater used by pybeautifier (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "formater": "autopep8" + } +} +``` + ##### [Ignore](#ignore) **Namespace**: `python` @@ -8444,11 +8475,11 @@ Automatically beautify Python files on save **Type**: `array` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -do not fix these errors/warnings (Supported by autopep8) +do not fix these errors/warnings (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -8472,11 +8503,11 @@ do not fix these errors/warnings (Supported by autopep8) **Type**: `integer` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -Indentation size/length (Supported by autopep8) +Indentation size/length (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -8498,11 +8529,11 @@ Indentation size/length (Supported by autopep8) **Type**: `integer` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -set maximum allowed line length (Supported by autopep8) +set maximum allowed line length (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -8514,6 +8545,34 @@ set maximum allowed line length (Supported by autopep8) } ``` +##### [Multi line output](#multi-line-output) + +**Namespace**: `python` + +**Key**: `multi_line_output` + +**Default**: `Hanging Grid Grouped` + +**Type**: `string` + +**Enum**: `Grid` `Vertical` `Hanging Indent` `Vertical Hanging Indent` `Hanging Grid` `Hanging Grid Grouped` `NOQA` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +defines how from imports wrap (requires isort installed) (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "multi_line_output": "Hanging Grid Grouped" + } +} +``` + ##### [Sort imports](#sort-imports) **Namespace**: `python` @@ -8522,11 +8581,11 @@ set maximum allowed line length (Supported by autopep8) **Type**: `boolean` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -sort imports (requires isort installed) (Supported by autopep8) +sort imports (requires isort installed) (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -8538,6 +8597,32 @@ sort imports (requires isort installed) (Supported by autopep8) } ``` +##### [Style config](#style-config) + +**Namespace**: `python` + +**Key**: `style_config` + +**Default**: `pep8` + +**Type**: `string` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +formatting style used by yapf (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "style_config": "pep8" + } +} +``` + #### [R](#r) **Supported Beautifiers**: [`formatR`](#formatr) @@ -16782,11 +16867,11 @@ List of tags (defaults to [head,body,/html] that should have an extra newline be **Type**: `integer` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -set maximum allowed line length (Supported by autopep8) +set maximum allowed line length (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -16808,11 +16893,11 @@ set maximum allowed line length (Supported by autopep8) **Type**: `integer` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -Indentation size/length (Supported by autopep8) +Indentation size/length (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -16834,11 +16919,11 @@ Indentation size/length (Supported by autopep8) **Type**: `array` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -do not fix these errors/warnings (Supported by autopep8) +do not fix these errors/warnings (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -16852,6 +16937,60 @@ do not fix these errors/warnings (Supported by autopep8) } ``` +##### [Formater](#formater) + +**Namespace**: `python` + +**Key**: `formater` + +**Default**: `autopep8` + +**Type**: `string` + +**Enum**: `autopep8` `yapf` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +formater used by pybeautifier (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "formater": "autopep8" + } +} +``` + +##### [Style config](#style-config) + +**Namespace**: `python` + +**Key**: `style_config` + +**Default**: `pep8` + +**Type**: `string` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +formatting style used by yapf (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "style_config": "pep8" + } +} +``` + ##### [Sort imports](#sort-imports) **Namespace**: `python` @@ -16860,11 +16999,11 @@ do not fix these errors/warnings (Supported by autopep8) **Type**: `boolean` -**Supported Beautifiers**: [`autopep8`](#autopep8) +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) **Description**: -sort imports (requires isort installed) (Supported by autopep8) +sort imports (requires isort installed) (Supported by autopep8, pybeautifier) **Example `.jsbeautifyrc` Configuration** @@ -16876,6 +17015,34 @@ sort imports (requires isort installed) (Supported by autopep8) } ``` +##### [Multi line output](#multi-line-output) + +**Namespace**: `python` + +**Key**: `multi_line_output` + +**Default**: `Hanging Grid Grouped` + +**Type**: `string` + +**Enum**: `Grid` `Vertical` `Hanging Indent` `Vertical Hanging Indent` `Hanging Grid` `Hanging Grid Grouped` `NOQA` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +defines how from imports wrap (requires isort installed) (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "multi_line_output": "Hanging Grid Grouped" + } +} +``` + ### coffee-fmt @@ -16985,6 +17152,195 @@ Indentation size/length (Supported by formatR) ``` +### pybeautifier + +##### [Max line length](#max-line-length) + +**Namespace**: `python` + +**Key**: `max_line_length` + +**Default**: `79` + +**Type**: `integer` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +set maximum allowed line length (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "max_line_length": 79 + } +} +``` + +##### [Indent size](#indent-size) + +**Namespace**: `python` + +**Key**: `indent_size` + +**Default**: `4` + +**Type**: `integer` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +Indentation size/length (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "indent_size": 4 + } +} +``` + +##### [Ignore](#ignore) + +**Namespace**: `python` + +**Key**: `ignore` + +**Default**: `E24` + +**Type**: `array` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +do not fix these errors/warnings (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "ignore": [ + "E24" + ] + } +} +``` + +##### [Formater](#formater) + +**Namespace**: `python` + +**Key**: `formater` + +**Default**: `autopep8` + +**Type**: `string` + +**Enum**: `autopep8` `yapf` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +formater used by pybeautifier (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "formater": "autopep8" + } +} +``` + +##### [Style config](#style-config) + +**Namespace**: `python` + +**Key**: `style_config` + +**Default**: `pep8` + +**Type**: `string` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +formatting style used by yapf (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "style_config": "pep8" + } +} +``` + +##### [Sort imports](#sort-imports) + +**Namespace**: `python` + +**Key**: `sort_imports` + +**Type**: `boolean` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +sort imports (requires isort installed) (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "sort_imports": false + } +} +``` + +##### [Multi line output](#multi-line-output) + +**Namespace**: `python` + +**Key**: `multi_line_output` + +**Default**: `Hanging Grid Grouped` + +**Type**: `string` + +**Enum**: `Grid` `Vertical` `Hanging Indent` `Vertical Hanging Indent` `Hanging Grid` `Hanging Grid Grouped` `NOQA` + +**Supported Beautifiers**: [`autopep8`](#autopep8) [`pybeautifier`](#pybeautifier) + +**Description**: + +defines how from imports wrap (requires isort installed) (Supported by autopep8, pybeautifier) + +**Example `.jsbeautifyrc` Configuration** + +```json +{ + "python": { + "multi_line_output": "Hanging Grid Grouped" + } +} +``` + + ### rustfmt ##### [Rustfmt path](#rustfmt-path)