Skip to content

Commit 365acc0

Browse files
krlmlrwael-sadek
authored andcommitted
Avoid auto-styling Rmd files for now
1 parent 306c85f commit 365acc0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/style/action.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ runs:
99
set -x
1010
scope=$( ( grep Config/autostyle/scope DESCRIPTION || true ) | cut -d " " -f 2)
1111
strict=$( ( grep Config/autostyle/strict DESCRIPTION || true ) | cut -d " " -f 2)
12+
rmd=$( ( grep Config/autostyle/rmd DESCRIPTION || true ) | cut -d " " -f 2)
1213
echo ::set-output name=scope::$scope
1314
echo ::set-output name=strict::$strict
15+
echo ::set-output name=rmd::$rmd
1416
shell: bash
1517

1618
- uses: actions/cache@v2
@@ -47,9 +49,17 @@ runs:
4749
run: |
4850
strict <- as.logical("${{ steps.check.outputs.strict }}")
4951
if (is.na(strict)) {
50-
strict = FALSE
52+
strict <- FALSE
5153
}
52-
styler::style_pkg(scope = "${{ steps.check.outputs.scope }}", strict = strict)
54+
rmd <- as.logical("${{ steps.check.outputs.rmd }}")
55+
if (is.na(rmd)) {
56+
rmd <- TRUE
57+
}
58+
styler::style_pkg(
59+
scope = "${{ steps.check.outputs.scope }}",
60+
strict = strict,
61+
filetype = c("R", "Rprofile", if (rmd) c("Rmd", "Rmarkdown", "Rnw", "Qmd"))
62+
)
5363
shell: Rscript {0}
5464

5565
- name: Show cache again

0 commit comments

Comments
 (0)