diff options
author | Neil Williams <neil.williams@linaro.org> | 2018-10-01 09:49:58 +0100 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2018-10-01 11:27:02 +0100 |
commit | b69f7c11e41e0094d49b2fe2f60a8bb8fb6ee019 (patch) | |
tree | 592ff764f4cec438bbd019e6517dd31522213b8d | |
parent | 8051f1ddfdb37781306e96e3a9d344ff85dca27d (diff) |
Ignore new PEP8 warning W504
Update for some occurrences of W604 but exclude files
where this is unrealistic.
Ignore W504 as this currently conflicts with black.
Signed-off-by: Neil Williams <neil.williams@linaro.org>
-rwxr-xr-x | ci-run | 2 | ||||
-rw-r--r-- | lava_common/constants.py | 16 | ||||
-rw-r--r-- | lava_dispatcher/actions/deploy/overlay.py | 8 | ||||
-rw-r--r-- | lava_dispatcher/protocols/multinode.py | 2 | ||||
-rw-r--r-- | lava_server/management/commands/jobs.py | 2 | ||||
-rw-r--r-- | lava_server/settings/config_file.py | 2 | ||||
-rwxr-xr-x | share/release-queue.py | 6 |
7 files changed, 19 insertions, 19 deletions
@@ -64,7 +64,7 @@ then exit 0 fi -pep8 --ignore E501,E203,W503 . +pep8 --ignore E501,E203,W503,W504 --exclude migrations,lava_scheduler_app/tests/test_api.py . if [ -n "${PEP8}" ] then diff --git a/lava_common/constants.py b/lava_common/constants.py index 25a23280f..52fb1d46c 100644 --- a/lava_common/constants.py +++ b/lava_common/constants.py @@ -86,17 +86,17 @@ BOOTLOADER_DEFAULT_CMD_TIMEOUT = 90 # kernel boot monitoring # Some successful kernel builds end the boot with this string -KERNEL_FREE_UNUSED_MSG = 'Freeing unused kernel memory' +KERNEL_FREE_UNUSED_MSG = r'Freeing unused kernel memory' # Some successful kernel builds end the boot with this string -KERNEL_FREE_INIT_MSG = 'Freeing init memory' +KERNEL_FREE_INIT_MSG = r'Freeing init memory' # exception -KERNEL_EXCEPTION_MSG = '-+\[ cut here \]-+\s+(.*\s+-+\[ end trace (\w*) \]-+)' +KERNEL_EXCEPTION_MSG = r'-+\[ cut here \]-+\s+(.*\s+-+\[ end trace (\w*) \]-+)' # stack trace -KERNEL_TRACE_MSG = 'Stack:\s+(.*\s+-+\[ end trace (\w*) \]-+)' +KERNEL_TRACE_MSG = r'Stack:\s+(.*\s+-+\[ end trace (\w*) \]-+)' # unhandled fault -KERNEL_FAULT_MSG = '(Unhandled fault.*)\r\n' +KERNEL_FAULT_MSG = r'(Unhandled fault.*)\r\n' # panic -KERNEL_PANIC_MSG = "Kernel panic - (.*) end Kernel panic" +KERNEL_PANIC_MSG = r"Kernel panic - (.*) end Kernel panic" # Login incorrect message LOGIN_INCORRECT_MSG = 'Login incorrect' @@ -113,10 +113,10 @@ DEFAULT_V1_PATTERN = "(?P<test_case_id>.*-*)\\s+:\\s+(?P<result>(PASS|pass|FAIL| DEFAULT_V1_FIXUP = {'PASS': 'pass', 'FAIL': 'fail', 'SKIP': 'skip', 'UNKNOWN': 'unknown'} # List of DD output prompts for notifying completion of secondary deployment -DD_PROMPTS = ['[0-9]+\+[0-9]+ records out', '[0-9]+ bytes \(.*\) copied'] +DD_PROMPTS = [r'[0-9]+\+[0-9]+ records out', r'[0-9]+ bytes \(.*\) copied'] # fallback UEFI menu label class -DEFAULT_UEFI_LABEL_CLASS = 'a-zA-Z0-9\s\:' +DEFAULT_UEFI_LABEL_CLASS = r'a-zA-Z0-9\s\:' # Set a default newline seperator for pexpect, override as necessary LINE_SEPARATOR = '\n' diff --git a/lava_dispatcher/actions/deploy/overlay.py b/lava_dispatcher/actions/deploy/overlay.py index 11d428132..ac6fe5452 100644 --- a/lava_dispatcher/actions/deploy/overlay.py +++ b/lava_dispatcher/actions/deploy/overlay.py @@ -370,11 +370,11 @@ class VlandOverlayAction(OverlayAction): def run(self, connection, max_end_time): """ Writes out file contents from lists, across multiple lines - VAR="VAL1\n\ - VAL2\n\ + VAR="VAL1\n + VAL2\n " - The \n and \ are used to avoid unwanted whitespace, so are escaped. - \n becomes \\n, \ becomes \\, which itself then needs \n to output: + The newline and escape characters are used to avoid unwanted whitespace. + \n becomes \\n, a single escape gets expanded and itself then needs \n to output: VAL1 VAL2 """ diff --git a/lava_dispatcher/protocols/multinode.py b/lava_dispatcher/protocols/multinode.py index 878ad7c72..2c828a78a 100644 --- a/lava_dispatcher/protocols/multinode.py +++ b/lava_dispatcher/protocols/multinode.py @@ -403,7 +403,7 @@ class MultinodeProtocol(Protocol): # pylint: disable=too-many-instance-attribut try: return self._api_select(json.dumps(args[0])) except (ValueError, TypeError) as exc: - msg = re.sub('\s+', ' ', ''.join(traceback.format_exc().split('\n'))) + msg = re.sub(r'\s+', ' ', ''.join(traceback.format_exc().split('\n'))) logger = logging.getLogger("dispatcher") logger.exception(msg) raise JobError("Invalid call to %s %s" % (self.name, exc)) diff --git a/lava_server/management/commands/jobs.py b/lava_server/management/commands/jobs.py index 3656c4e9d..ec86c93a2 100644 --- a/lava_server/management/commands/jobs.py +++ b/lava_server/management/commands/jobs.py @@ -109,7 +109,7 @@ class Command(BaseCommand): jobs = TestJob.objects.all().order_by('id') if older_than is not None: - pattern = re.compile("^(?P<time>\d+)(?P<unit>(h|d))$") + pattern = re.compile(r"^(?P<time>\d+)(?P<unit>(h|d))$") match = pattern.match(older_than) if match is None: raise CommandError("Invalid older-than format") diff --git a/lava_server/settings/config_file.py b/lava_server/settings/config_file.py index 4d4b357df..d4185c10b 100644 --- a/lava_server/settings/config_file.py +++ b/lava_server/settings/config_file.py @@ -33,7 +33,7 @@ class ConfigFile: """ _pattern = re.compile( - "^(?P<key>[_a-zA-Z][_a-zA-Z0-9]*)=['\"](?P<value>[^']*)['\"]\s*(?:#.*)?$") + r"^(?P<key>[_a-zA-Z][_a-zA-Z0-9]*)=['\"](?P<value>[^']*)['\"]\s*(?:#.*)?$") @classmethod def load(cls, pathname): diff --git a/share/release-queue.py b/share/release-queue.py index e6f124e24..0a8cb5571 100755 --- a/share/release-queue.py +++ b/share/release-queue.py @@ -25,9 +25,9 @@ import subprocess import time -change_id_pattern = re.compile("\s+Change-Id: (\w+)") -commit_pattern = re.compile("commit (.+)") -author_pattern = re.compile("author ([^>]+>) (\w+) ((\+|-)\w\w\w\w)") +change_id_pattern = re.compile(r"\s+Change-Id: (\w+)") +commit_pattern = re.compile(r"commit (.+)") +author_pattern = re.compile(r"author ([^>]+>) (\w+) ((\+|-)\w\w\w\w)") class Commit: |