From 8006f86de583af81fe719bdb3d4a1b2568352a32 Mon Sep 17 00:00:00 2001 From: Kevin O'Gorman Date: Mon, 16 Oct 2023 10:18:57 -0400 Subject: [PATCH 1/4] changed order of lint checks to put translations last --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f293317cf..64f6da56e9 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ yamllint: ## Lint YAML files (does not validate syntax!). # While the order mostly doesn't matter here, keep "check-ruff" first, since it # gives the broadest coverage and runs (and therefore fails) fastest. .PHONY: lint -lint: check-ruff ansible-config-lint app-lint check-black check-desktop-files check-strings check-supported-locales html-lint shellcheck typelint yamllint ## Runs all lint checks +lint: check-ruff ansible-config-lint app-lint check-black html-lint shellcheck typelint yamllint check-strings check-desktop-files check-supported-locales ## Runs all lint checks .PHONY: safety safety: ## Run `safety check` to check python dependencies for vulnerabilities. From 62231d62a383f56100b043fccf30c13cbe151c71 Mon Sep 17 00:00:00 2001 From: Kevin O'Gorman Date: Mon, 16 Oct 2023 10:30:03 -0400 Subject: [PATCH 2/4] add some printfs to make lint job output clearer --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 64f6da56e9..ee6144754f 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,7 @@ yamllint: ## Lint YAML files (does not validate syntax!). # While the order mostly doesn't matter here, keep "check-ruff" first, since it # gives the broadest coverage and runs (and therefore fails) fastest. .PHONY: lint -lint: check-ruff ansible-config-lint app-lint check-black html-lint shellcheck typelint yamllint check-strings check-desktop-files check-supported-locales ## Runs all lint checks +lint: check-ruff ansible-config-lint app-lint check-black html-lint shellcheck typelint yamllint check-strings check-supported-locales check-desktop-files ## Runs all lint checks .PHONY: safety safety: ## Run `safety check` to check python dependencies for vulnerabilities. @@ -349,6 +349,7 @@ DESKTOP_POT=$(DESKTOP_LOCALE_DIR)/messages.pot .PHONY: check-strings check-strings: $(POT) $(DESKTOP_POT) ## Check that the translation catalogs are up to date with source code. + @echo "███ Checking translation catalogs..." @$(MAKE) --no-print-directory extract-strings @git diff --quiet $^ || { echo "Translation catalogs are out of date. Please run \"make extract-strings\" and commit the changes."; exit 1; } @@ -382,6 +383,7 @@ $(POT): securedrop .PHONY: check-desktop-files check-desktop-files: ${DESKTOP_BASE}/*.j2 + @echo "███ Checking desktop translation catalogs..." @$(MAKE) --always-make --no-print-directory update-desktop-files @git diff --quiet $^ || [[ "$$CIRCLE_PR_USERNAME" == "weblate-fpf" ]] || { echo "Desktop files are out of date. Please run \"make update-desktop-files\" and commit the changes."; exit 1; } @@ -425,6 +427,7 @@ $(DESKTOP_I18N_CONF): .PHONY: check-supported-locales check-supported-locales: $(I18N_LIST) $(DESKTOP_I18N_CONF) ## Check that the desktop and documentation lists of supported locales are up to date. + @echo "███ Checking supported locales..." @$(MAKE) --no-print-directory update-supported-locales @git diff --quiet $^ || { echo "Desktop and/or documentation lists of supported locales are out of date. Please run \"make update-supported-locales\" and commit the changes."; exit 1; } From 2e6b905d1e9af49d5f743436797689f2a47d919f Mon Sep 17 00:00:00 2001 From: Cory Francis Myers Date: Mon, 16 Oct 2023 14:33:42 -0700 Subject: [PATCH 3/4] fix(check-desktop-strings): enforce forward compatibility with gettext 0.21 behavior Fixes #7007. Beginning in gettext 0.21---specifically, as of autotools-mirror/gettext@1c9b721---xgettext and (of interest to us) msgfmt do not localize the "Icon" keyword. That's fine, indeed preferable, for our purposes. But since Ubuntu Focal only has gettext 0.19, where they do, we need to pass an explicit "--keyword=Name" here to get consistent output across platforms. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ee6144754f..bff76e3eb2 100644 --- a/Makefile +++ b/Makefile @@ -415,6 +415,7 @@ $(DESKTOP_POT): ${DESKTOP_BASE}/*.in @msgfmt \ -d ${DESKTOP_LOCALE_DIR} \ --desktop \ + --keyword=Name \ --template $< \ --output-file $@ @rm ${DESKTOP_LOCALE_DIR}/*.po From 60f8afbeb5c0a03140c84b0263721fef5220d151 Mon Sep 17 00:00:00 2001 From: Cory Francis Myers Date: Mon, 16 Oct 2023 16:17:01 -0700 Subject: [PATCH 4/4] build(check-desktop-files): explain how to get Weblate pull requests passing This partially reverts commit d4f47e1349ac164dba74bec6c76e669a4b29eaa7. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bff76e3eb2..eb79c1d160 100644 --- a/Makefile +++ b/Makefile @@ -385,7 +385,7 @@ $(POT): securedrop check-desktop-files: ${DESKTOP_BASE}/*.j2 @echo "███ Checking desktop translation catalogs..." @$(MAKE) --always-make --no-print-directory update-desktop-files - @git diff --quiet $^ || [[ "$$CIRCLE_PR_USERNAME" == "weblate-fpf" ]] || { echo "Desktop files are out of date. Please run \"make update-desktop-files\" and commit the changes."; exit 1; } + @git diff --quiet $^ || { echo "Desktop files are out of date. Please run \"make update-desktop-files\" and commit the changes. (If this is a translation pull request from Weblate, a maintainer can append the new commit to this branch so that CI passes before merge.)"; exit 1; } .PHONY: update-desktop-files update-desktop-files: ${DESKTOP_BASE}/*.j2