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.
This commit is contained in:
Dimitri Papadopoulos 2022-07-17 08:53:34 +02:00 committed by Adrien Vergé
parent 19d00809d1
commit e0f749bf5d

View File

@ -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: