Skip to content

Commit

Permalink
Prefer autopep8 (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn authored Mar 26, 2018
1 parent 44aa4fa commit aaa362c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ out/
# Distribution / packaging
.Python
env/
env3/
build/
develop-eggs/
dist/
Expand Down
4 changes: 2 additions & 2 deletions pyls/plugins/autopep8_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
log = logging.getLogger(__name__)


@hookimpl
@hookimpl(tryfirst=True) # Prefer autopep8 over YAPF
def pyls_format_document(config, document):
log.info("Formatting document %s with autopep8", document)
return _format(config, document)


@hookimpl
@hookimpl(tryfirst=True) # Prefer autopep8 over YAPF
def pyls_format_range(config, document, range): # pylint: disable=redefined-builtin
log.info("Formatting document %s in range %s with autopep8", document, range)

Expand Down
4 changes: 2 additions & 2 deletions pyls/plugins/yapf_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
log = logging.getLogger(__name__)


@hookimpl(tryfirst=True) # Prefer YAPF over autopep8 if available
@hookimpl
def pyls_format_document(document):
return _format(document)


@hookimpl(tryfirst=True) # Prefer YAPF over autopep8 if available
@hookimpl
def pyls_format_range(document, range): # pylint: disable=redefined-builtin
# First we 'round' the range up/down to full lines only
range['start']['character'] = 0
Expand Down

0 comments on commit aaa362c

Please sign in to comment.