flake8 is a Python tool that glues together pycodestyle, pyflakes,
mccabe, and third-party plugins to check the style and quality of some
Python code.
Currently we've issue in phase2 in checksum step:
/bin/sh: 2: Syntax error: ")" unexpected
And it seems, that flake8 is able to spot places which might lead to
such issues during runtime:
phase2/master.cfg:733:151: W605 invalid escape sequence '\('
phase2/master.cfg:733:155: W605 invalid escape sequence '\)'
phase2/master.cfg:733:158: W605 invalid escape sequence '\('
phase2/master.cfg:733:162: W605 invalid escape sequence '\)'
So lets enable flake8 checking on the CI so we can spot similar places
in the future and address them before deployment.
We dont want to make current ongoing work on phase2 code harder, thus we
don't touch that part yet, so we whitelist most of the checks for now.
References:
f0faed2970dd ("phase2: compute checksums")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
--- /dev/null
+[flake8]
+max-line-length = 140
+per-file-ignores =
+ phase2/master.cfg: E101,E117,E128,E201,E202,E203,E221,E225,E251,E266,E302,E305,E501,W191
- name: Lint with ruff
run: ruff phase*/master.cfg
- name: Lint with ruff
run: ruff phase*/master.cfg
+ - name: Lint with flake8
+ run: flake8 phase*/master.cfg
+
- name: Stylecheck with black
run: black phase1/master.cfg
- name: Stylecheck with black
run: black phase1/master.cfg
!.ruff.toml
!tests
!tests/**/*
!.ruff.toml
!tests
!tests/**/*
# a shorter alias to save typing.
c = BuildmasterConfig = {}
# a shorter alias to save typing.
c = BuildmasterConfig = {}
-####### PROJECT IDENTITY
# the 'title' string will appear at the top of this buildbot
# installation's html.WebStatus home page (linked to the
# the 'title' string will appear at the top of this buildbot
# installation's html.WebStatus home page (linked to the
c["buildbotURL"] = inip1.get("buildbot_url")
c["buildbotURL"] = inip1.get("buildbot_url")
# The 'workers' list defines the set of recognized buildworkers. Each element is
# a Worker object, specifying a unique worker name and password. The same
# The 'workers' list defines the set of recognized buildworkers. Each element is
# a Worker object, specifying a unique worker name and password. The same
c["prioritizeBuilders"] = prioritizeBuilders
c["prioritizeBuilders"] = prioritizeBuilders
# find targets
targets = dict()
# find targets
targets = dict()
# Configure the Schedulers, which decide how to react to incoming changes.
# Configure the Schedulers, which decide how to react to incoming changes.
schedulers.Triggerable(name="trigger", builderNames=builderNames, priority=20)
)
schedulers.Triggerable(name="trigger", builderNames=builderNames, priority=20)
)
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
# The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# what steps, and which workers can execute them. Note that any particular build will
name="gitverify",
description="Ensuring that Git HEAD is pointing to a branch or tag",
descriptionDone="Git HEAD is sane",
name="gitverify",
description="Ensuring that Git HEAD is pointing to a branch or tag",
descriptionDone="Git HEAD is sane",
- command='git rev-parse --abbrev-ref HEAD | grep -vxqF HEAD || git show-ref --tags --dereference 2>/dev/null | sed -ne "/^$(git rev-parse HEAD) / { s|^.*/||; s|\\^.*||; p }" | grep -qE "^v[0-9][0-9]\\."',
+ command=(
+ "git rev-parse --abbrev-ref HEAD | grep -vxqF HEAD || "
+ "git show-ref --tags --dereference 2>/dev/null | sed -ne "
+ '"/^$(git rev-parse HEAD) / { s|^.*/||; s|\\^.*||; p }" | grep -qE "^v[0-9][0-9]\\."'
+ ),
name="newconfig",
descriptionDone=".config seeded",
command=Interpolate(
name="newconfig",
descriptionDone=".config seeded",
command=Interpolate(
- "printf 'CONFIG_TARGET_%(kw:target)s=y\\nCONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\nCONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config",
+ "printf 'CONFIG_TARGET_%(kw:target)s=y\\n"
+ "CONFIG_TARGET_%(kw:target)s_%(kw:subtarget)s=y\\n"
+ "CONFIG_SIGNED_PACKAGES=%(kw:usign:#?|y|n)s\\n' >> .config",
target=target,
subtarget=subtarget,
usign=GetUsignKey,
target=target,
subtarget=subtarget,
usign=GetUsignKey,
name="kernelversion",
property="kernelversion",
description="Finding the effective Kernel version",
name="kernelversion",
property="kernelversion",
description="Finding the effective Kernel version",
- command="make --no-print-directory -C target/linux/ val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | xargs printf '%s-%s-%s\\n'",
+ command=(
+ "make --no-print-directory -C target/linux/ "
+ "val.LINUX_VERSION val.LINUX_RELEASE val.LINUX_VERMAGIC | "
+ "xargs printf '%s-%s-%s\\n'"
+ ),
env={"TOPDIR": Interpolate("%(prop:builddir)s/build")},
)
)
env={"TOPDIR": Interpolate("%(prop:builddir)s/build")},
)
)
description="Packing files to sign",
descriptionDone="Files to sign packed",
command=Interpolate(
description="Packing files to sign",
descriptionDone="Files to sign packed",
command=Interpolate(
- "find bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/ bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/kmods/ -mindepth 1 -maxdepth 2 -type f -name sha256sums -print0 -or -name Packages -print0 | xargs -0 tar -czf sign.tar.gz",
+ "find bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/ "
+ "bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/kmods/ "
+ "-mindepth 1 -maxdepth 2 -type f -name sha256sums -print0 -or "
+ "-name Packages -print0 | xargs -0 tar -czf sign.tar.gz",
target=target,
subtarget=subtarget,
),
target=target,
subtarget=subtarget,
),
name="sourcelist",
description="Finding source archives to upload",
descriptionDone="Source archives to upload found",
name="sourcelist",
description="Finding source archives to upload",
descriptionDone="Source archives to upload found",
- command="find dl/ -maxdepth 1 -type f -not -size 0 -not -name '.*' -not -name '*.hash' -not -name '*.dl' -newer .config -printf '%f\\n' > sourcelist",
+ command=(
+ "find dl/ -maxdepth 1 -type f -not -size 0 "
+ "-not -name '.*' -not -name '*.hash' -not -name "
+ "'*.dl' -newer .config -printf '%f\\n' > sourcelist"
+ ),
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
# 'status' is a list of Status Targets. The results of each build will be
# pushed to these targets. buildbot/status/*.py has a variety to choose from,
r"https://git.openwrt.org/?p=openwrt/\1.git;a=commit;h=%s",
)
r"https://git.openwrt.org/?p=openwrt/\1.git;a=commit;h=%s",
)
c["db"] = {
# This specifies what database buildbot uses to store its state. You can leave
c["db"] = {
# This specifies what database buildbot uses to store its state. You can leave
cram==0.7
black==23.3.0
ruff==0.0.267
cram==0.7
black==23.3.0
ruff==0.0.267