-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cbind-merge-list-prep
- Loading branch information
Showing
94 changed files
with
11,920 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
^\.devcontainer$ | ||
^\.graphics$ | ||
^\.github$ | ||
^\.vscode$ | ||
^\.zed$ | ||
|
||
^\.gitlab-ci\.yml$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Use msgfmt to check for untranslated/fuzzy messages, and for whether | ||
# the implied .mo compiled form matches that which is already checked in | ||
msgfmt_linter <- function(po_file) { | ||
mo_tmp <- tempfile() | ||
on.exit(unlink(mo_tmp)) | ||
|
||
res = system2("msgfmt", c("--statistics", po_file, "-o", mo_tmp), stdout=TRUE, stderr=TRUE) | ||
if (any(grepl("untranslated message|fuzzy translation", res))) { | ||
cat(sprintf("In %s, found incomplete translations:\n%s\n", po_file, paste(res, collapse="\n"))) | ||
stop("Please fix.") | ||
} | ||
|
||
mo_ref = sprintf( | ||
"inst/%s/LC_MESSAGES/%sdata.table.mo", | ||
gsub("^R-|[.]po$", "", po_file), | ||
if (startsWith(basename(po_file), "R-")) "R-" else "" | ||
) | ||
|
||
if (!file.exists(mo_ref)) { | ||
stop(po_file, " has not been compiled as ", mo_ref, ". Please fix.") | ||
} | ||
if (tools::md5sum(mo_ref) == tools::md5sum(mo_tmp)) return(invisible()) | ||
# TODO(#6517): Re-activate this part of the check to ensure .mo is up to date. | ||
cat(sprintf("Note: MD5 sum of msgfmt output for %s does not match %s.\n", po_file, mo_ref)) | ||
return(invisible()) | ||
|
||
# NB: file.mtime() will probably be wrong, it will reflect the check-out time of the git repo. | ||
last_edit_time = system2("git", | ||
c("log", "-1", '--format="%ad"', "--date=format:'%Y-%m-%d %H:%M:%S'", "--", mo_ref), | ||
stdout=TRUE | ||
) | ||
cat(sprintf( | ||
".mo compilation %s of .po translation %s appears out of date! It was last updated %s\n", | ||
mo_ref, po_file, last_edit_time | ||
)) | ||
|
||
unmo_tmp = tempfile() | ||
unmo_ref = tempfile() | ||
on.exit(unlink(c(unmo_tmp, unmo_ref)), add=TRUE) | ||
system2("msgunfmt", c(mo_tmp, "-o", unmo_tmp)) | ||
system2("msgunfmt", c(mo_ref, "-o", unmo_ref)) | ||
cat("Here are the observed differences after converting back to .po:\n\n") | ||
system2("diff", c(unmo_tmp, unmo_ref)) | ||
stop("Please fix.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
tools_check_linter = function(po_file) { | ||
res = tools::checkPoFile(po_file, strictPlural=TRUE) | ||
if (NROW(res)) { | ||
print(res) | ||
stop("Fix the above .po file issues.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
utf8_linter <- function(po_file) { | ||
if (!any(grepl("charset=UTF-8", readLines(po_file), fixed=TRUE))) | ||
stop("In ", po_file, ", please use charset=UTF-8.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class1_linter = lintr::make_linter_from_xpath( | ||
" | ||
//OP-LEFT-BRACKET[ | ||
preceding-sibling::expr/expr/SYMBOL_FUNCTION_CALL[text() = 'class'] | ||
and following-sibling::expr/NUM_CONST[text() = '1' or text() = '1L'] | ||
] | ||
/parent::expr | ||
", | ||
"Use class1(x) to get class(x)[1L], or classes1(x) to do so for a full list/data.table" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Autocomment atime-based performance regression analysis on PRs | ||
name: atime performance tests | ||
|
||
on: | ||
pull_request: | ||
|
@@ -15,10 +15,11 @@ on: | |
|
||
jobs: | ||
comment: | ||
if: github.repository == 'Rdatatable/data.table' | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/iterative/cml:0-dvc2-base1 | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: Anirban166/[email protected].0 | ||
- uses: Anirban166/[email protected].1 |
Oops, something went wrong.