# Create upsteam tag
deb_tag=$(dpkg-parsechangelog -S version | cut -d- -f1)
-git tag upstream/${deb_tag}
+git tag "upstream/${deb_tag}"
-gbp buildpackage --git-ignore-branch $*
+gbp buildpackage --git-ignore-branch "$@"
# Undo packaging changes
-git tag -d upstream/${deb_tag}
+git tag -d "upstream/${deb_tag}"
# Return an error if architectures are not defined
if not self.arch:
- raise SyntaxError(f"ARCH not defined in annotations")
+ raise SyntaxError("ARCH not defined in annotations")
# Return an error if flavours are not defined
if not self.flavour:
- raise SyntaxError(f"FLAVOUR not defined in annotations")
+ raise SyntaxError("FLAVOUR not defined in annotations")
# Parse body
self._parse_body(data)
# format.
try:
self._legacy_parse(data)
- except SyntaxError as e:
+ except SyntaxError:
self._json_parse(data, is_included=False)
def _remove_entry(self, config: str):
if val != old_val and "note" in self.config[conf]:
self.config[conf]["note"] = "TODO: update note"
print(
- f"WARNING: {conf} changed from {old_val} to {val}, updating note"
+ f"WARNING: {conf} changed from {old_val} to {val}, "
+ "updating note"
)
self.config[conf]["policy"][flavour] = val
else:
sys.dont_write_bytecode = True
-import os
-import argparse
-import json
-from signal import signal, SIGPIPE, SIG_DFL
+import os # noqa: E402 Import not at top of file
+import argparse # noqa: E402 Import not at top of file
+import json # noqa: E402 Import not at top of file
+from signal import signal, SIGPIPE, SIG_DFL # noqa: E402 Import not at top of file
try:
from argcomplete import autocomplete
pass
-from kconfig.annotations import Annotation, KConfig
-from kconfig.utils import autodetect_annotations, arg_fail
-from kconfig.version import VERSION, ANNOTATIONS_FORMAT_VERSION
+from kconfig.annotations import ( # noqa: E402 Import not at top of file
+ Annotation,
+ KConfig,
+)
+from kconfig.utils import ( # noqa: E402 Import not at top of file
+ autodetect_annotations,
+ arg_fail,
+)
+from kconfig.version import ( # noqa: E402 Import not at top of file
+ VERSION,
+ ANNOTATIONS_FORMAT_VERSION,
+)
SKIP_CONFIGS = (
action="store",
metavar="FILE",
dest="update_file",
- help="Import a partial .config into annotations (only resync configs specified in FILE)",
+ help="Import a partial .config into annotations "
+ "(only resync configs specified in FILE)",
)
ga.add_argument(
"--check",
policy = data["config"][key]["policy"]
if "note" in data["config"][key]:
note = data["config"][key]["note"]
- out += f' "{key}": {{"policy": {json.dumps(policy)}, "note": {json.dumps(note)}}},\n'
+ out += f' "{key}": {{"policy": {json.dumps(policy)}, "note": {json.dumps(note)}}},\n' # noqa: E501 Line too long
else:
out += f' "{key}": {{"policy": {json.dumps(policy)}}},\n'
out = out.rstrip(",\n")
if ret:
if os.path.exists(".git"):
print(
- f"check-config: {num} config options have been changed, review them with `git diff`"
+ f"check-config: {num} config options have been changed, "
+ "review them with `git diff`"
)
else:
print(f"check-config: {num} config options have changed")
sys.dont_write_bytecode = True # pylint: disable=E0402
-import re
-import argparse
-from argcomplete import autocomplete
-
-from kconfig.utils import autodetect_annotations, arg_fail
-from kconfig.version import VERSION
+import re # noqa: E402 Import not at top of file
+import argparse # noqa: E402 Import not at top of file
+from argcomplete import autocomplete # noqa: E402 Import not at top of file
+
+from kconfig.utils import ( # noqa: E402 Import not at top of file
+ autodetect_annotations,
+ arg_fail,
+)
+from kconfig.version import VERSION # noqa: E402 Import not at top of file
def make_parser():