single_quote_linter()
no longer causes a print issue when open quote appears at a column > than close quote (#457, @jamieRowen)absolute_path_linter()
and nonportable_path_linter()
now handle file-paths that are wrapped with double-quotes (#433, #437, @russHyde).get_source_expressions()
has been changed to handle expr_or_assign_or_help
tokens arising when parsing code containing equals-assignments in R-devel (#403, #456, @russHyde).object_usage_linter
has been changed to ensure lint-position is indicated relative to the start of the file, rather than the start of a defining function (#432, @russHyde).lintr 2.0.0 is a major release, and incorporates development changes since the last major release (1.0.0) in 2016-04-16.
camel_case_linter()
, snake_case_linter()
and multiple_dots_linter()
in favor of object_name_linter()
which enforce the given style: snake_case, dotted.case, lowerCamelCalse, UpperCamelCase, alllowercase or ALLUPPERCASE (#59, @fangly).absolute_path_linter()
, with a lax mode for fewer false positive lints (#199, fangly).cyclocomp_linter()
identifies overly complex functions (#361, @fabian-s)equals_na_linter()
(#143, #326, @jabranham)extraction_operator_linter()
checks that the [[
operator is used when extracting a single element from an object, not [
(subsetting) nor $
(interactive use) (@fangly).function_left_parentheses_linter()
to check that there is no space between a function name and its left parentheses (#204, @jrnold).implicit_integer_linter()
detects round numbers not declared as integers, i.e. 1 instead of 1L (@fangly).nonportable_path_linter()
identifies paths constructed without file.path() (@fangly).paren_brace_linter()
checks that there is a space between right parenthesis and an opening curly brace (@bfgray3, #242).pipe_continuation_linter()
to ensure there is a space before %>% and newline afterwards (#216).semicolon_terminator_linter()
reports semicolons at the end a line (#147,
seq_linter()
, finds 1:length(...)
(and similar) expressions (#155, 1)todo_comment_linter()
lints TODOs (@fangly).T_and_F_symbol_linter()
warns when using T and F instead of TRUE and FALSE (@fangly).undesirable_operator_linter()
and undesirable_function_linter()
lint uses of user-specified functions and operators (#48, #149, @fangly).unneeded_concatenation_linter()
lints uses of c() with a constant or no arguments (@fangly).expect_lint()
(#178, #210)ids_with_token()
and with_id()
(#297 @stufield)lint_dir()
function to lint files under a given directory (@arekbee, #360)summary.lints()
function to summarize the linter results (#260, #262, @wlandau).checkstyle_output()
function to output lints to checkstyle XML output (#156, @joshkgold)closed_curly_linter()
now allows closing parenthesis or comma after closing curly brace (#167, @Enchufa2)commas_linter()
now handles missing arguments calls properly (#145)commented_code_linter()
now relaxed, it no longer lints comments within roxygen blocks and does not consider “-” an R operator to avoid too many false positives.function_left_parentheses_linter()
now allows spaces if a function starts with a left parenthesis (#311)no_tab_linter()
now reports proper line in all cases (#134, @fangly)object_length_linter()
argument length
now defaults to 30 for consistency (#325 @DragosMG)object_name_linter()
now works when passed multiple styles (#341, @infotroph)object_usage_linter()
has been changed to better detect lexical scoping of global variables (#27, #336, #91, #382)object_usage_linter()
now respects utils::globalVariables()
, so it can be used to avoid false positive warnings due to non-standard evaluation (#352)object_usage_linter()
now ignores top level calls that contain function definitions (#26).object_linter*()
s now only lint objects declared in the current file (#76, #108, #136, #191, #194, #201, @fangly).open_curly_linter()
and closed_curly_linter()
now do not lint double curly syntax (#388)open_curly_linter()
now allows comments after the curly braces (#188)pipe_continuation_linter()
now behaves better in nested expressions, functions etc. (#366 @russHyde)space_inside_linter()
now reports proper line and column numbers (#203, @fangly)expect_lint()
now no longer shows Rstudio markers and error messages are correctly preserved (#180, #211, @fangly)Lint()
/ as.data.frame()
error now fixed (#179, @fangly).lint()
no longer errors with inline \\Sexpr
(#127).lint()
no longer errors with ‘<% %>’ constructs (#185).lint_package()
now works with the cache, as intended (#146, @schloerke)lint_package()
now excludes R/RcppExports.R
by default (#282)lint_package()
now removes fully excluded files as soon as possible toseq_linter
is now one of the default linters (#316).read_settings()
now has a better error message when the config file does not end with a newline (#160, #189)expect_lint_free()
is now automatically skipped when run on covr (#287)GITHUB_TOKEN
environment variable (#63, @mattyb)#
to start a comment. Useful in ESS (#299, @prosoitos)engine format
were parsed from R-markdown (#322, @russHyde)lintr
runs / installs / tests on R-3.6: pinned to github xmlparsedata
; ensure vectors are length-1 when compared using &&
and ||
(#363 #377 #384 #391, @russHyde).expect_lint_free()
now is always skipped on CRAN. This is necessary because the non-binary R source may not be available when running tests on CRAN, and those tests may not be run in the package directory.=
in named arguments. (#130, @saurfang).(
type (#128, @saurfang)names.lints
, split.lints
(#49, @ttriche).lintr
config files.globalenv()
instead of baseenv()
for default parent environment so that methods
will be included.trailing_whitespace_linter
was reporting the incorrect line number