pull/896/head
Bill Wendling 2 years ago
parent c578dc4a88
commit 7fed727275
  1. 4
      yapf/yapflib/format_decision_state.py
  2. 4
      yapf/yapflib/reformatter.py

@ -741,8 +741,8 @@ class FormatDecisionState(object):
# Calculate the penalty for overflowing the column limit.
penalty = 0
if (not current.is_pylint_comment and not current.is_pytype_comment
and not current.is_copybara_comment and self.column > self.column_limit):
if (not current.is_pylint_comment and not current.is_pytype_comment and
not current.is_copybara_comment and self.column > self.column_limit):
excess_characters = self.column - self.column_limit
penalty += style.Get('SPLIT_PENALTY_EXCESS_CHARACTER') * excess_characters

@ -259,8 +259,8 @@ def _CanPlaceOnSingleLine(uwline):
indent_amt = style.Get('INDENT_WIDTH') * uwline.depth
last = uwline.last
last_index = -1
if (last.is_pylint_comment or last.is_pytype_comment
or last.is_copybara_comment):
if (last.is_pylint_comment or last.is_pytype_comment or
last.is_copybara_comment):
last = last.previous_token
last_index = -2
if last is None:

Loading…
Cancel
Save