[CI] Format code according to conventions (#24095)

Format code according to conventions
This commit is contained in:
QMK Bot 2024-07-11 23:50:39 +10:00 committed by GitHub
parent 1b8b6801d4
commit 2e671cfd8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,18 +48,20 @@ def _ansi2html_styles():
return "\n".join([str(s) for s in styles]) return "\n".join([str(s) for s in styles])
def _git_log(count = 4): def _git_log(count=4):
os.chdir(qmk_firmware_dir) os.chdir(qmk_firmware_dir)
ret = _run(f"git log -n {count} --color=always --no-merges --topo-order --stat").stdout.strip() ret = _run(f"git log -n {count} --color=always --no-merges --topo-order --stat").stdout.strip()
os.chdir(orig_cwd) os.chdir(orig_cwd)
return ret return ret
def _git_describe(): def _git_describe():
os.chdir(qmk_firmware_dir) os.chdir(qmk_firmware_dir)
ret = _run("git describe --tags --always --dirty").stdout.strip() ret = _run("git describe --tags --always --dirty").stdout.strip()
os.chdir(orig_cwd) os.chdir(orig_cwd)
return ret return ret
def _git_revision(): def _git_revision():
os.chdir(qmk_firmware_dir) os.chdir(qmk_firmware_dir)
ret = _run("git rev-parse HEAD").stdout.strip() ret = _run("git rev-parse HEAD").stdout.strip()
@ -88,22 +90,18 @@ for mdfile in list(sorted(build_dir.glob("failed.log.*"))):
txt = KEYBOARD_PATTERN.sub("", KEYMAP_PATTERN.sub("", txt)).strip() txt = KEYBOARD_PATTERN.sub("", KEYMAP_PATTERN.sub("", txt)).strip()
failures.append( failures.append({
{ "stdout": txt,
"stdout": txt, "keyboard": m_kb.group("keyboard"),
"keyboard": m_kb.group("keyboard"), "keymap": m_km.group("keymap"),
"keymap": m_km.group("keymap"), })
}
)
template = env.get_template("index.html.j2") template = env.get_template("index.html.j2")
print( print(template.render(
template.render( ansi2html_styles=_ansi2html_styles(),
ansi2html_styles=_ansi2html_styles(), git_log=_git_log(),
git_log=_git_log(), git_describe=_git_describe(),
git_describe=_git_describe(), git_revision=_git_revision(),
git_revision=_git_revision(), binaries=binaries,
binaries=binaries, failures=failures,
failures=failures, ))
)
)