Chore/lints (#5917)
continuous-integration/drone/push Build is passing

just running some linters on all files

---------

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5917
Reviewed-by: tobiasd <181+tobiasd@fsfe.org>
Co-authored-by: delliott <420+delliott@fsfe.org>
Co-committed-by: delliott <420+delliott@fsfe.org>
This commit was merged in pull request #5917.
This commit is contained in:
delliottandDarragh Elliott authored and tobiasd committed 2026-06-11 09:06:32 +00:00
1 parent fdd4720409
commit c74d9e0d1f
4 files changed
+16 -19

No files matched your search

+3 -11
View File
@@ -159,11 +159,7 @@ def _run_build(global_build_config: GlobalBuildConfig) -> None:
full(global_build_config.source)
global_symlinks(
global_build_config.source,
(
global_build_config.languages
if global_build_config.languages
else global_build_config.all_languages
),
(global_build_config.languages or global_build_config.all_languages),
pool,
)
# Create our stable config across all sites
@@ -182,12 +178,8 @@ def _run_build(global_build_config: GlobalBuildConfig) -> None:
global_build_config,
site,
)
languages: list[str] = (
global_build_config.languages
if global_build_config.languages
else sorted(
{lang_from_filename(path) for path in site.glob("**/*.*.xhtml")},
)
languages: list[str] = global_build_config.languages or sorted(
{lang_from_filename(path) for path in site.glob("**/*.*.xhtml")},
)
# Now we know our languages, build our site build config
site_build_config = SiteBuildConfig(languages, site)
@@ -28,9 +28,11 @@ def prepare_subdirectories(
logger.info("Preparing Subdirectories")
for subdir_path in sorted(
(path.parent for path in source_site.glob("**/subdir.py")),
key=lambda directory: directory.joinpath("subdir-prio.txt").read_text().strip()
if directory.joinpath("subdir-prio.txt").exists()
else "0",
key=lambda directory: (
directory.joinpath("subdir-prio.txt").read_text().strip()
if directory.joinpath("subdir-prio.txt").exists()
else "0"
),
):
logger.info("Preparing subdirectory %s", subdir_path)
sys.path.append(str(subdir_path.resolve()))
+4 -2
View File
@@ -89,8 +89,10 @@ def run(source: Path, languages: list[str], processes: int, working_dir: Path) -
[
(working_dir, file)
for file in filter(
lambda path: lang_from_filename(path) in languages
and etree.parse(path).xpath("//html[@newsdate]"),
lambda path: (
lang_from_filename(path) in languages
and etree.parse(path).xpath("//html[@newsdate]")
),
working_dir.glob("**/*.??.xhtml"),
)
],
+4 -3
View File
@@ -90,9 +90,10 @@ def run(source: Path, languages: list[str], processes: int, working_dir: Path) -
tags_by_lang: defaultdict[str, dict[str, str | None]] = defaultdict(dict)
# Fill out files_by_tag and tags_by_lang
for file in filter(
lambda file:
# Not in tags dir of a source_dir
working_dir not in file.parents,
lambda file: (
# Not in tags dir of a source_dir
working_dir not in file.parents
),
working_dir.parent.glob("**/*.xml"),
):
for tag in etree.parse(file).xpath("//tag"):