You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Introduce and document .ci/lint.R
For use in both .github/workflows/code-quality.yaml and manually,
especially when developing the linters.
* code-quality: switch lint-c, lint-po to .ci/lint.R
* code-quality: switch lint-md to .ci/lint.R
* lint-md: make sure to use Rscript
* Update .ci/lint.R
Use str2lang().
Co-authored-by: Michael Chirico <[email protected]>
* Update .ci/linters/md/heading_id_linter.R
Co-authored-by: Michael Chirico <[email protected]>
* Update .ci/linters/md/news_linter.R
Co-authored-by: Michael Chirico <[email protected]>
* lint.R: move preprocessing to a special function
The preprocessing functions were too unwieldy to leave them on the
command line. This makes it possible to run any lint check directly from
the command line before committing code.
Co-authored-by: Michael Chirico <[email protected]>
---------
Co-authored-by: Michael Chirico <[email protected]>
Copy file name to clipboardExpand all lines: .ci/README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,23 @@ Base R implemented helper script, [originally proposed to base R](https://svn.r-
50
50
51
51
Base R implemented helper script to orchestrate generation of most artifacts and to arrange them nicely. It is being used only in [_integration_ stage in GitLab CI pipeline](./../.gitlab-ci.yml).
52
52
53
+
### [`lint.R`](./lint.R)
54
+
55
+
Base R runner for the manual (non-`lintr`) lint checks to be run from GitHub Actions during the code quality check. The command line arguments are as follows:
56
+
1. Path to the directory containing files defining the linters. A linter is a function that accepts one argument (typically the path to the file) and signals an error if it fails the lint check.
57
+
2. Path to the directory containing files to check.
58
+
3. A regular expression matching the files to check.
59
+
60
+
One of the files in the linter directory may define the `.preprocess` function, which must accept one file path and return a value that other linter functions will understand. The function may also return `NULL` to indicate that the file must be skipped.
61
+
62
+
Example command lines:
63
+
64
+
```sh
65
+
Rscript .ci/lint.R .ci/linters/c src '[.][ch]$'
66
+
Rscript .ci/lint.R .ci/linters/po po '[.]po$'
67
+
Rscript .ci/lint.R .ci/linters/md .'[.]R?md$'
68
+
```
69
+
53
70
## GitLab Open Source Program
54
71
55
72
We are currently part of the [GitLab for Open Source Program](https://about.gitlab.com/solutions/open-source/). This gives us 50,000 compute minutes per month for our GitLab CI. Our license needs to be renewed yearly (around July) and is currently managed by @ben-schwen.
0 commit comments