Skip to content

Commit

Permalink
add linting; closes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
bfgray3 committed Jan 25, 2019
1 parent 72b1a7c commit dfd935b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .Rbuildignore
@@ -1,3 +1,4 @@
^\.lintr$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
@@ -1,9 +1,13 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
warnings_are_errors: true
sudo: false
cache: packages
r_packages:
- covr
- lintr
after_success:
- Rscript -e 'covr::codecov()'
- R CMD INSTALL $PKG_TARBALL
- Rscript -e 'lintr::lint_package()'
- Rscript -e 'covr::codecov()'
1 change: 1 addition & 0 deletions DESCRIPTION
Expand Up @@ -29,6 +29,7 @@ License: MIT + file LICENSE
Suggests:
covr,
knitr,
lintr,
nycflights13,
ranger,
rmarkdown,
Expand Down

1 comment on commit dfd935b

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/freq.R:39:3: warning: local variable ‘nms’ assigned but may not be used

nms <- names(train)
  ^~~

R/label.R:132:3: warning: local variable ‘nms’ assigned but may not be used

nms <- names(train)
  ^~~

R/RcppExports.R:7:1: style: Trailing blank lines are superfluous.

^

R/utils.R:36:1: style: lines should not be more than 80 characters.

error = function(e) stop("'", col_spec, "' is not a valid column specification for ",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/helpers.R:2:7: style: Put spaces around all infix operators.

y <- 2^seq(from = 0, to = 5)
     ~^~

tests/testthat/helpers.R:20:13: warning: no visible binding for global variable ‘df_fact’

fact <- df_fact
            ^~~~~~~

tests/testthat/helpers.R:21:13: warning: no visible binding for global variable ‘df_char’

char <- df_char
            ^~~~~~~

tests/testthat/helpers.R:23:13: warning: no visible binding for global variable ‘tbl_fact’

fact <- tbl_fact
            ^~~~~~~~

tests/testthat/helpers.R:24:13: warning: no visible binding for global variable ‘tbl_char’

char <- tbl_char
            ^~~~~~~~

tests/testthat/helpers.R:45:13: warning: no visible binding for global variable ‘df_fact’

fact <- df_fact
            ^~~~~~~

tests/testthat/helpers.R:46:13: warning: no visible binding for global variable ‘df_char’

char <- df_char
            ^~~~~~~

tests/testthat/helpers.R:48:13: warning: no visible binding for global variable ‘tbl_fact’

fact <- tbl_fact
            ^~~~~~~~

tests/testthat/helpers.R:49:13: warning: no visible binding for global variable ‘tbl_char’

char <- tbl_char
            ^~~~~~~~

tests/testthat/helpers.R:70:13: warning: no visible binding for global variable ‘df_fact’

fact <- df_fact
            ^~~~~~~

tests/testthat/helpers.R:71:13: warning: no visible binding for global variable ‘df_char’

char <- df_char
            ^~~~~~~

tests/testthat/helpers.R:73:13: warning: no visible binding for global variable ‘tbl_fact’

fact <- tbl_fact
            ^~~~~~~~

tests/testthat/helpers.R:74:13: warning: no visible binding for global variable ‘tbl_char’

char <- tbl_char
            ^~~~~~~~

tests/testthat/helpers.R:89:13: warning: no visible binding for global variable ‘df_fact’

fact <- df_fact
            ^~~~~~~

tests/testthat/helpers.R:90:13: warning: no visible binding for global variable ‘df_char’

char <- df_char
            ^~~~~~~

tests/testthat/helpers.R:92:13: warning: no visible binding for global variable ‘tbl_fact’

fact <- tbl_fact
            ^~~~~~~~

tests/testthat/helpers.R:93:13: warning: no visible binding for global variable ‘tbl_char’

char <- tbl_char
            ^~~~~~~~

tests/testthat/test-conditions.R:10:1: style: lines should not be more than 80 characters.

regexp = "All columns must be numeric, character, or factor. 'x', 'y' are not.",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-conditions.R:28:1: style: lines should not be more than 80 characters.

regexp = "`response` not supplied; using first column 'a' as the response variable.",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-dummy.R:21:1: style: lines should not be more than 80 characters.

expected_x1_tbl_fact <- dplyr::tibble(y, x2 = factor(x2), x1b = c(0, 1, NA, 1, 0, 0))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-freq.R:19:1: style: lines should not be more than 80 characters.

expected_x1_tbl_char <- dplyr::tibble(y, x1 = as.integer(c(3, 2, NA, 2, 3, 3)), x2)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-freq.R:21:1: style: lines should not be more than 80 characters.

expected_x1_tbl_fact <- dplyr::tibble(y, x1 = as.integer(c(3, 2, NA, 2, 3, 3)), x2 = factor(x2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-label.R:86:18: style: Commas should never have a space before.

observed = ,
                ~^

tests/testthat/test-mean.R:22:1: style: lines should not be more than 80 characters.

expected_x1_tbl_char <- dplyr::tibble(y, x1 = c(49 / 3, 5, NA, 5, 49 / 3, 49 / 3), x2)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-median.R:24:1: style: lines should not be more than 80 characters.

expected_x1_tbl_fact <- dplyr::tibble(y, x1 = c(16, 5, NA, 5, 16, 16), x2 = factor(x2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-median.R:33:1: style: lines should not be more than 80 characters.

both_encoded <- check_x1_x2_resp(catto_median, "data.frame", .resp = resp_name)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test-onehot.R:3:7: style: Put spaces around all infix operators.

y <- 2^seq(from = 0, to = 4)
     ~^~

Please sign in to comment.