Skip to content

Prefer YAPF over autopep8 #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pylsp/plugins/autopep8_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
log = logging.getLogger(__name__)


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


@hookimpl(tryfirst=True) # Prefer autopep8 over YAPF
@hookimpl
def pylsp_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 pylsp/plugins/yapf_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
log = logging.getLogger(__name__)


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


@hookimpl
@hookimpl(tryfirst=True) # Prefer YAPF over autopep8
def pylsp_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