Skip to content

Commit

Permalink
yapf: disable arithmetic predecence indication (#16749)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Mar 30, 2022
1 parent 6cdf230 commit 64974a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/python/qmk/cli/generate/rgb_breathe_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_rgb_breathe_table(cli):
"""
breathe_values = [0] * 256
for pos in range(0, 256):
breathe_values[pos] = (int)((math.exp(math.sin((pos/255) * math.pi)) - cli.args.center / math.e) * (cli.args.max / (math.e - 1 / math.e))) # noqa: yapf insists there be no whitespace around /
breathe_values[pos] = (int)((math.exp(math.sin((pos / 255) * math.pi)) - cli.args.center / math.e) * (cli.args.max / (math.e - 1 / math.e)))

values_template = ''
for s in range(0, 3):
Expand All @@ -46,7 +46,7 @@ def generate_rgb_breathe_table(cli):
values_template += ' ' if pos % 8 == 0 else ''
values_template += '0x{:02X}'.format(breathe_values[pos])
values_template += ',' if (pos + step) < 256 else ''
values_template += '\n' if (pos+step) % 8 == 0 else ' ' # noqa: yapf insists there be no whitespace around +
values_template += '\n' if (pos + step) % 8 == 0 else ' '

values_template += '#endif'
values_template += '\n\n' if s < 2 else ''
Expand Down
14 changes: 7 additions & 7 deletions lib/python/qmk/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def render_key_rect(textpad, x, y, w, h, label, style):

label_blank = ' ' * label_len
label_border = box_chars['h'] * label_len
label_middle = label + ' '*label_leftover # noqa: yapf insists there be no whitespace around *
label_middle = label + ' ' * label_leftover

top_line = array('u', box_chars['tl'] + label_border + box_chars['tr'])
lab_line = array('u', box_chars['v'] + label_middle + box_chars['v'])
Expand All @@ -245,10 +245,10 @@ def render_key_isoenter(textpad, x, y, w, h, label, style):
if len(label) > label_len:
label = label[:label_len]

label_blank = ' ' * (label_len-1) # noqa: yapf insists there be no whitespace around - and *
label_blank = ' ' * (label_len - 1)
label_border_top = box_chars['h'] * label_len
label_border_bottom = box_chars['h'] * (label_len-1) # noqa
label_middle = label + ' '*label_leftover # noqa
label_border_bottom = box_chars['h'] * (label_len - 1)
label_middle = label + ' ' * label_leftover

top_line = array('u', box_chars['tl'] + label_border_top + box_chars['tr'])
lab_line = array('u', box_chars['v'] + label_middle + box_chars['v'])
Expand Down Expand Up @@ -277,10 +277,10 @@ def render_key_baenter(textpad, x, y, w, h, label, style):
if len(label) > label_len:
label = label[:label_len]

label_blank = ' ' * (label_len-3) # noqa: yapf insists there be no whitespace around - and *
label_border_top = box_chars['h'] * (label_len-3) # noqa
label_blank = ' ' * (label_len - 3)
label_border_top = box_chars['h'] * (label_len - 3)
label_border_bottom = box_chars['h'] * label_len
label_middle = label + ' '*label_leftover # noqa
label_middle = label + ' ' * label_leftover

top_line = array('u', box_chars['tl'] + label_border_top + box_chars['tr'])
mid_line = array('u', box_chars['v'] + label_blank + box_chars['v'])
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ allow_split_before_dict_value=True
# e = 1*2 - 3
# f = 1 + 2 + 3 + 4
#
arithmetic_precedence_indication=True
arithmetic_precedence_indication=False

# Number of blank lines surrounding top-level function and class
# definitions.
Expand Down

0 comments on commit 64974a7

Please sign in to comment.