diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-05-14 20:13:48 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-05-14 20:22:04 +0300 |
commit | df1e7872cba3de9b6f564c585d4e423aa1452581 (patch) | |
tree | 3689b3dd41c894c71ca9a95a699e0a4d5825b45c | |
parent | 7ee154d67d14272433a7ab2dd87e2e7378e763f2 (diff) |
Fix some escaping issues reported by latest pycodestyle
Also disable W504 (line break after binary operator). The existing code is
formatted to satisify W503 (Line break occurred before a binary operator).
-rwxr-xr-x | calm/package.py | 2 | ||||
-rwxr-xr-x | pep8 | 3 | ||||
-rwxr-xr-x | test/test_calm.py | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/calm/package.py b/calm/package.py index 7575050..6a1df72 100755 --- a/calm/package.py +++ b/calm/package.py @@ -259,7 +259,7 @@ def read_package(packages, basedir, dirpath, files, remove=[], upload=False): # # P must match the package name, V can contain anything, R must # start with a number - match = re.match(r'^' + re.escape(p) + '-(.+)-(\d[0-9a-zA-Z.]*)(-src|)\.' + match.group(1) + '$', f) + match = re.match(r'^' + re.escape(p) + r'-(.+)-(\d[0-9a-zA-Z.]*)(-src|)\.' + match.group(1) + '$', f) if not match: logging.error("file '%s' in package '%s' doesn't follow naming convention" % (f, p)) return True @@ -1,4 +1,3 @@ #!/bin/sh set -e -grep -s -l '^#!/usr/bin/env python' * calm/* test/* | xargs python3 -m pycodestyle --count --show-source --max-line-length=240 --ignore=E129,E741 -flake8 --ignore E129,E501,E741,F841 +grep -s -l '^#!/usr/bin/env python' * calm/* test/* | xargs python3 -m pycodestyle --count --show-source --max-line-length=240 --ignore=E129,E741,W504 diff --git a/test/test_calm.py b/test/test_calm.py index f514b7d..322d776 100755 --- a/test/test_calm.py +++ b/test/test_calm.py @@ -415,11 +415,11 @@ class CalmTest(unittest.TestCase): os.chdir(os.path.dirname(os.path.abspath(__file__))) # ensure sha512.sum files exist - os.system("find testdata/relarea/x86 testdata/relarea/noarch -type d -exec sh -c 'cd {} ; sha512sum * >sha512.sum 2>/dev/null' \;") + os.system("find testdata/relarea/x86 testdata/relarea/noarch -type d -exec sh -c 'cd {} ; sha512sum * >sha512.sum 2>/dev/null' \\;") # should remove a sha512.sum file so that we test functioning when it's absent os.unlink('testdata/relarea/x86/release/arc/sha512.sum') # remove !ready files - os.system("find testdata/homes -name !ready -exec rm {} \;") + os.system("find testdata/homes -name !ready -exec rm {} \\;") # fix up package timestamps so highest version is also latest # (git doesn't store timestamps, so they will all be dated the time of checkout) |