mirror of
https://github.com/adrienverge/yamllint.git
synced 2024-11-22 07:36:25 -06:00
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:
parent
19d00809d1
commit
e0f749bf5d
@ -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…
Reference in New Issue
Block a user