Skip to content

Commit f607df0

Browse files
Reorganize .po linters for extensibility, similarity to other checks
1 parent b4966ed commit f607df0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
incomplete_translation_linter <- function(po_file) {
2+
res = system2("msgfmt", c("--statistics", po_file, "-o", tempfile()), stdout=TRUE, stderr=TRUE)
3+
if (any(grepl("untranslated message|fuzzy translation", res))) {
4+
cat(sprintf("In %s, found incomplete translations:\n%s\n", po_file, paste(res, collapse="\n")))
5+
stop("Please fix.")
6+
}
7+
}

.github/workflows/code-quality.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ jobs:
5959
linter_env = new.env()
6060
for (f in list.files('.ci/linters/po', full.names=TRUE)) sys.source(f, linter_env)
6161
for (po_file in list.files(pattern = "[.]po$", full.names=TRUE)) {
62-
# only pay attention to files edited in the current PR, otherwise we can get
63-
# a situation like after #6424 where some untranslated messages were added
64-
# as part of non-translation maintenance, but this GHA would go red repeatedly
65-
# until a translation is added or the blank/fuzzy translations removed. We'd
66-
# rather only have the failure on one PR, then ignore these files later.
67-
diff_v_master = system2("git", c("diff", "master", po_file), stdout=TRUE)
68-
if (!length(diff_v_master)) next
6962
for (linter in ls(linter_env)) linter_env[[linter]](po_file)
7063
}
7164
shell: Rscript {0}

0 commit comments

Comments
 (0)