line_length: skip all hash signs starting comment

This commit is contained in:
Patryk Małek
2021-03-24 18:04:48 +01:00
committed by GitHub
parent 5d8ef2ea23
commit e53ea093e2
2 changed files with 26 additions and 1 deletions

View File

@@ -140,7 +140,11 @@ def check(conf, line):
start += 1
if start != line.end:
if line.buffer[start] in ('#', '-'):
if line.buffer[start] == '#':
while line.buffer[start] == '#':
start += 1
start += 1
elif line.buffer[start] == '-':
start += 2
if line.buffer.find(' ', start, line.end) == -1: