comments-indentation: Refactor to use 'max' builtin

It is unnecessary to use an `if` statement to check the maximum of two
values and then assign the value to a name. You can use the max
built-in do do this. It is straightforward and more readable.
pull/484/head
Dimitri Papadopoulos 3 years ago
parent 60b0f9f21f
commit 5d56eb49d5
No known key found for this signature in database
GPG Key ID: 95998121D9D25F5D

@ -117,8 +117,7 @@ def check(conf, comment):
# # comment
# - 1
# - 2
if prev_line_indent <= next_line_indent:
prev_line_indent = next_line_indent
prev_line_indent = max(prev_line_indent, next_line_indent)
# If two indents are valid but a previous comment went back to normal
# indent, for the next ones to do the same. In other words, avoid this:

Loading…
Cancel
Save