2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#3287] fix pycodestyle warnings

- E111 indentation is not a multiple of 4
- E117 over-indented
- E125 continuation line with same indent as next logical line
- E127 continuation line over-indented for visual indent
- E128 continuation line under-indented for visual indent
- E129 visually indented line with same indent as next logical line
- E131 continuation line unaligned for hanging indent
- E201 whitespace after '['
- E201 whitespace after '{'
- E202 whitespace before ')'
- E202 whitespace before ']'
- E202 whitespace before '}'
- E203 whitespace before '
- E203 whitespace before ','
- E222 multiple spaces after operator
- E225 missing whitespace around operator
- E228 missing whitespace around modulo operator
- E231 missing whitespace after ','
- E251 unexpected spaces around keyword / parameter equals
- E261 at least two spaces before inline comment
- E262 inline comment should start with '# '
- E265 block comment should start with '# '
- E301 expected 1 blank line, found 0
- E302 expected 2 blank lines, found 1
- E303 too many blank lines (2)
- E305 expected 2 blank lines after class or function definition, found 1
- E306 expected 1 blank line before a nested definition, found 0
- E401 multiple imports on one line
- E402 module level import not at top of file
- E501 line too long
- E502 the backslash is redundant between brackets
- E703 statement ends with a semicolon
- E713 test for membership should be 'not in'
- E722 do not use bare 'except'
- E741 ambiguous variable name 'l'
- W605 invalid escape sequence '\/'
This commit is contained in:
Andrei Pavel
2024-06-06 15:41:10 +03:00
parent c0acd781c9
commit 8e37580e59
13 changed files with 338 additions and 240 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -18,6 +18,7 @@
import sys
def remove_empty_leading_trailing(lines):
"""
Removes leading and trailing empty lines.
@@ -112,7 +113,7 @@ def make_dict(lines):
message_key = canonicalise_message_line(lines[0])
message_lines = [message_key]
index = 1;
index = 1
while index < len(lines):
if lines[index].startswith("%"):
# Start of new message
@@ -145,8 +146,8 @@ def print_dict(dictionary):
count = count + 1
# ... and the entry itself.
for l in dictionary[msgid]:
print(l.strip())
for line in dictionary[msgid]:
print(line.strip())
def process_file(filename):