Skip to content

Commit

Permalink
Add pyment for Python (sbdchd#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
alok authored and sbdchd committed Jul 1, 2018
1 parent ebe9ed9 commit 27e310a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ that caused Neoformat to be invoked.
[`black`](https://github.com/ambv/black)
- [`isort`](https://github.com/timothycrosley/isort)
- [`docformatter`](https://github.com/myint/docformatter)
- [`pyment`](https://github.com/dadadel/pyment)
- Reason
- [`refmt`](https://github.com/facebook/reason)
- Ruby
Expand Down
11 changes: 10 additions & 1 deletion autoload/neoformat/formatters/python.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function! neoformat#formatters#python#enabled() abort
return ['yapf', 'autopep8', 'black', 'isort', 'docformatter']
return ['yapf', 'autopep8', 'black', 'isort', 'docformatter', 'pyment']
endfunction

function! neoformat#formatters#python#yapf() abort
Expand Down Expand Up @@ -42,3 +42,12 @@ function! neoformat#formatters#python#black() abort
\ 'args': ['-', '2>/dev/null'],
\ }
endfunction


function! neoformat#formatters#python#pyment() abort
return {
\ 'exe': 'pyment',
\ 'stdin': 1,
\ 'args': ['-w', '-'],
\ }
endfunction
11 changes: 6 additions & 5 deletions doc/neoformat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,13 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
- [`yapf`](https://github.com/google/yapf),
[`autopep8`](https://github.com/hhatto/autopep8),
[`black`](https://github.com/ambv/black)
[isort](https://github.com/timothycrosley/isort)
[docformatter](https://github.com/myint/docformatter)
[`isort`](https://github.com/timothycrosley/isort)
[`docformatter`](https://github.com/myint/docformatter)
[`pyment`](https://github.com/dadadel/pyment)
- Reason
- [`refmt`](https://github.com/facebook/reason)
- Ruby
- [rufo](https://github.com/asterite/rufo)
- [`rufo`](https://github.com/asterite/rufo)
- [`ruby-beautify`](https://github.com/erniebrodeur/ruby-beautify)
- [`rubocop`](https://github.com/bbatsov/rubocop)
- Rust
Expand All @@ -337,8 +338,8 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
- Shell
- [`shfmt`](https://github.com/mvdan/sh)
- SQL
- `sqlformat` (ships with [sqlparse](https://github.com/andialbrecht/sqlparse))
- `pg_format` (ships with [pgFormatter](https://github.com/darold/pgFormatter))
- `sqlformat` (ships with [`sqlparse`](https://github.com/andialbrecht/sqlparse))
- `pg_format` (ships with [`pgFormatter`](https://github.com/darold/pgFormatter))
- Terraform
- [`terraform`](https://www.terraform.io/docs/commands/fmt.html)
- Typescript
Expand Down

0 comments on commit 27e310a

Please sign in to comment.