@@ -40,40 +40,24 @@ jobs:
4040 run : /usr/bin/sudo apt-get -y install coccinelle
4141 - name : Lint
4242 run : |
43- linter_env = new.env()
44- for (f in list.files('.ci/linters/c', full.names=TRUE)) sys.source(f, linter_env)
45- for (f in list.files('src', pattern='[.][ch]$', full.names=TRUE)) {
46- c_obj = list(path = f, lines = readLines(f))
47- c_obj$preprocessed = system2("gcc", c("-fpreprocessed", "-E", f), stdout=TRUE, stderr=FALSE)
48- for (linter in ls(linter_env)) linter_env[[linter]](c_obj)
49- # TODO(#6272): Incorporate more checks from CRAN_Release
50- }
51- shell : Rscript {0}
43+ Rscript .ci/lint.R .ci/linters/c src '[.][ch]$'
5244 lint-po :
5345 runs-on : ubuntu-latest
5446 steps :
5547 - uses : actions/checkout@v4
5648 - uses : r-lib/actions/setup-r@v2
5749 - name : Check translations
50+ # only pay attention to files edited in the current PR, otherwise we can get
51+ # a situation like after #6424 where some untranslated messages were added
52+ # as part of non-translation maintenance, but this GHA would go red repeatedly
53+ # until a translation is added or the blank/fuzzy translations removed. We'd
54+ # rather only have the failure on one PR, then ignore these files later.
5855 run : |
59- linter_env = new.env()
60- for (f in list.files('.ci/linters/po', full.names=TRUE)) sys.source(f, linter_env)
61- 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
69- for (linter in ls(linter_env)) linter_env[[linter]](po_file)
70- }
71- shell : Rscript {0}
56+ Rscript .ci/lint.R .ci/linters/po po '[.]po$'
7257 lint-md :
7358 runs-on : ubuntu-latest
7459 steps :
7560 - uses : actions/checkout@v4
7661 - uses : r-lib/actions/setup-r@v2
7762 - name : Lint
78- run : for (f in list.files('.ci/linters/md', full.names=TRUE)) source(f)
79- shell : Rscript {0}
63+ run : Rscript .ci/lint.R .ci/linters/md . '[.]R?md$'
0 commit comments