Skip to content

Commit e5bb0e3

Browse files
authored
Merge branch 'master' into master
2 parents 4e05d8d + f6dca2d commit e5bb0e3

File tree

19 files changed

+94
-45
lines changed

19 files changed

+94
-45
lines changed

.ci/linters/c/cocci_linter.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cocci_linter = if (!nzchar(Sys.which("spatch"))) function(...) {} else function(c_obj) {
2+
bad <- FALSE
3+
for (spfile in list.files(".ci/linters/cocci", full.names = TRUE)) {
4+
# Coccinelle parser gets confused sometimes, so ignore stderr and the exit code
5+
out = suppressWarnings(system2(
6+
"spatch",
7+
shQuote(c(
8+
"--sp-file", spfile, c_obj$path, "--recursive-includes",
9+
"-I", R.home("include"), "-I", "src"
10+
)),
11+
stdout = TRUE, stderr = FALSE
12+
))
13+
if (length(out) > 0) {
14+
cat(sprintf("In file '%s', Coccinelle patch '%s' recommends the following changes:\n", c_obj$path, spfile))
15+
writeLines(out)
16+
bad <- TRUE
17+
}
18+
}
19+
if (bad) stop("Please apply the changes above or fix the linter")
20+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@@
2+
type T;
3+
T* E;
4+
@@
5+
- (T*)
6+
E

.ci/linters/md/heading_id_linter.R

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
any_mismatch = FALSE
2+
3+
# ensure that ids are limited to alphanumerics and dashes
4+
# (in particular, dots and underscores break the links)
5+
check_header_ids = function(md) {
6+
# A bit surprisingly, some headings don't start with a letter.
7+
# We're interested in those that set an id to link to, i.e., end with {#id}.
8+
heading_captures = regmatches(md, regexec("^#+ \\S.*[{]#([^}]*)[}]$", md))
9+
lines_with_id = which(lengths(heading_captures) > 0)
10+
ids = vapply(heading_captures[lines_with_id], `[`, '', 2)
11+
# ids must start with a letter and consist of alphanumerics or dashes.
12+
good_ids = grepl('^[A-Za-z][A-Za-z0-9-]*$', ids)
13+
for (line in lines_with_id[!good_ids]) cat(sprintf(
14+
"On line %d, bad heading id '%s':\n%s\n",
15+
line, heading_captures[[line]][2], heading_captures[[line]][1]
16+
))
17+
!all(good_ids)
18+
}
19+
20+
any_error = FALSE
21+
for (vignette in list.files('vignettes', pattern = "[.]Rmd$", recursive = TRUE, full.name = TRUE)) {
22+
cat(sprintf("Checking vignette file %s...\n", vignette))
23+
rmd_lines = readLines(vignette)
24+
any_error = check_header_ids(rmd_lines) || any_error
25+
}
26+
if (any_error) stop("Please fix the vignette issues above.")

.github/workflows/code-quality.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v4
3737
- uses: r-lib/actions/setup-r@v2
38+
- name: Install Coccinelle
39+
# relying on the action above us to have updated the package cache
40+
run: /usr/bin/sudo apt-get -y install coccinelle
3841
- name: Lint
3942
run: |
4043
linter_env = new.env()
1.21 KB
Binary file not shown.
-17 Bytes
Binary file not shown.

po/R-ru.po

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: data.table 1.15.99\n"
44
"POT-Creation-Date: 2025-01-29 23:31-0800\n"
5-
"PO-Revision-Date: 2025-01-31 13:52+0300\n"
5+
"PO-Revision-Date: 2025-02-02 22:32+0300\n"
66
"Last-Translator: Ivan Krylov <[email protected]>\n"
77
"Language-Team: Russian <https://translate.codeberg.org/projects/data-table-"
88
"ru/gettext-R/ru/>\n"
@@ -3552,13 +3552,11 @@ msgstr[1] "%d переменные не показаны: %s\n"
35523552
msgstr[2] "%d переменных не показано: %s\n"
35533553

35543554
#: setops.R:46
3555-
#, fuzzy
3556-
#| msgid "unsupported column type(s) found in x or y: %s"
35573555
msgid "unsupported column type found in x or y: %s"
35583556
msgid_plural "unsupported column types found in x or y: %s"
3559-
msgstr[0] "В «x» или «y» нашлись столбцы неподдерживаемых типов: %s"
3560-
msgstr[1] "В «x» или «y» нашлись столбцы неподдерживаемых типов: %s"
3561-
msgstr[2] "В «x» или «y» нашлись столбцы неподдерживаемых типов: %s"
3557+
msgstr[0] "в «x» или «y» нашлись столбцы неподдерживаемых типов: %s"
3558+
msgstr[1] "в «x» или «y» нашлись столбцы неподдерживаемых типов: %s"
3559+
msgstr[2] "в «x» или «y» нашлись столбцы неподдерживаемых типов: %s"
35623560

35633561
#: test.data.table.R:255
35643562
msgid "%d error out of %d. Search %s for test number %s. Duration: %s."
@@ -3569,10 +3567,6 @@ msgstr[1] "%d ошибки из %d. Ищите в %s тесты №№%s. Про
35693567
msgstr[2] "%d ошибок из %d. Ищите в %s тесты №№%s. Продолжительность: %s."
35703568

35713569
#: utils.R:36
3572-
#, fuzzy
3573-
#| msgid ""
3574-
#| "%s has some duplicated column name(s): %s. Please remove or rename the "
3575-
#| "duplicate(s) and try again."
35763570
msgid ""
35773571
"%s has duplicated column name %s. Please remove or rename the duplicate and "
35783572
"try again."

po/data.table.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,12 +2692,12 @@ msgstr ""
26922692

26932693
#: fwrite.c:909
26942694
#, c-format
2695-
msgid "Can't write gzip header error: %d"
2695+
msgid "Failed to write gzip header. Write returned %d"
26962696
msgstr ""
26972697

26982698
#: fwrite.c:910
26992699
#, c-format
2700-
msgid "Compress gzip error: %d"
2700+
msgid "Failed to compress gzip. compressbuff() returned %d"
27012701
msgstr ""
27022702

27032703
#: fwrite.c:911 fwrite.c:928

po/ru.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ msgstr "i[%d] = %d, что находится за пределами диапа
207207
#: assign.c:387
208208
#, c-format
209209
msgid "Assigning to %d row subset of %d rows\n"
210-
msgstr "Присвоение %d подмножеству строк%d\n"
210+
msgstr "Присвоение подмножеству из %d строк (всего %d)\n"
211211

212212
#: assign.c:403
213213
msgid "length(LHS)==0; no columns to delete or assign RHS to."
@@ -285,7 +285,7 @@ msgstr ""
285285
"%d переданным столбцам присваивается пустой список (который может быть "
286286
"пустой data.table или data.frame, поскольку они тоже являются списками). "
287287
"Чтобы удалить несколько столбцов, используйте вместо этого значение NULL. "
288-
"Чтобы добавить несколько пустых списочных столбцов, используйте list(list())."
288+
"Чтобы добавить несколько пустых столбцов-списков, используйте list(list())."
289289

290290
#: assign.c:456
291291
#, c-format
@@ -453,7 +453,7 @@ msgid ""
453453
msgstr ""
454454
"В правой части элемент №%d был скопирован, поскольку MAYBE_REFERENCED==%d "
455455
"MAYBE_SHARED==%d, но потом присваивается напрямую. length(правая_часть)==%d; "
456-
"length(левая_часть)==%d)\n"
456+
"length(левая_часть)==%d\n"
457457

458458
#: assign.c:569
459459
#, c-format
@@ -2576,8 +2576,8 @@ msgid ""
25762576
"Read %<PRIu64> rows x %d columns from %s file in %02d:%06.3f wall clock "
25772577
"time\n"
25782578
msgstr ""
2579-
"Чтение %<PRIu64> строк * %d столбцов из файла %s заняло %02d:%06.3f по "
2580-
"часам\n"
2579+
"Чтение %<PRIu64> строк * %d столбцов из файла %s заняло %02d:%06.3f "
2580+
"мин:с\n"
25812581

25822582
#: fread.c:2733
25832583
msgid "[12] Finalizing the datatable\n"
@@ -3371,7 +3371,7 @@ msgid ""
33713371
"No list columns are present. Setting sep2='' otherwise quote='auto' would "
33723372
"quote fields containing sep2.\n"
33733373
msgstr ""
3374-
"Нет списочных столбцов. Если задать sep2=''; в противном случае quote='auto' "
3374+
"Нет столбцов-списков. Задаю sep2=''; в противном случае quote='auto' "
33753375
"приведёт к тому, что поля, содержащие sep2, будут заключены в кавычки.\n"
33763376

33773377
#: fwriteR.c:288

src/assign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ void writeNA(SEXP v, const int from, const int n, const bool listNA)
12071207
memset(RAW(v)+from, 0, n*sizeof(Rbyte));
12081208
break;
12091209
case LGLSXP: {
1210-
int *vd = (int *)LOGICAL(v);
1210+
int *vd = LOGICAL(v);
12111211
for (int i=from; i<=to; ++i) vd[i] = NA_LOGICAL;
12121212
} break;
12131213
case INTSXP: {

0 commit comments

Comments
 (0)