Fix flake 3.6.0 warnings

flake 3.6.0 introduces a couple of new tests, handle them in the zuul
base:

* Disable "W504 line break after binary operator", this is a new warning
  with different coding style.
* Fix "F841 local variable 'e' is assigned to but never used"
* Fix "W605 invalid escape sequence" - use raw strings for regexes.
* Fix "F901 'raise NotImplemented' should be 'raise
  NotImplementedError'"
* Ignore "E252 missing whitespace around parameter equals" since it
  reports on parameters like:
  def makeNewJobs(self, old_job, parent: Job=None):

Change "flake8: noqa" to "noqa" since "flake8: noqa" is a file level
noqa and gets ignored with flake 3.6.0 if it's not at beginning of line
- this results in many warnings for files ./zuul/driver/bubblewrap/__init__.py and
./zuul/cmd/migrate.py. Fix any issues there.

Change-Id: Ia79bbc8ac0cd8e4819f61bda0091f4398464c5dc
This commit is contained in:
Andreas Jaeger
2018-10-28 15:29:06 +01:00
parent f856841c49
commit d9059524e0
14 changed files with 70 additions and 68 deletions

View File

@@ -22,13 +22,12 @@ import os
import psutil
import pwd
import shlex
import subprocess
import sys
import threading
import re
import struct
from typing import Dict, List # flake8: noqa
from typing import Dict, List # noqa
from zuul.driver import (Driver, WrapperInterface)
from zuul.execution_context import BaseExecutionContext
@@ -171,7 +170,7 @@ class BubblewrapDriver(Driver, WrapperInterface):
log = logging.getLogger("zuul.BubblewrapDriver")
name = 'bubblewrap'
release_file_re = re.compile('^\W+-release$')
release_file_re = re.compile(r'^\W+-release$')
def __init__(self):
self.bwrap_command = self._bwrap_command()
@@ -258,7 +257,7 @@ def main(args=None):
if cli_args.secret:
for secret in cli_args.secret:
fn, content = secret.split('=', 1)
secrets[fn]=content
secrets[fn] = content
context = driver.getExecutionContext(
cli_args.ro_paths, cli_args.rw_paths,