sample(n, m)
is now reported and can be rewritten as sample.int(n, m)
when n
is a literal integer.Rule names have been harmonized to use a dash instead of underscore, e.g.
any_duplicated-1
instead of any_duplicated_1
.
Replacement of redundant_ifelse_linter
of the form
ifelse(cond, FALSE, TRUE)
now works (#57).
absolute_path_linter
was deactivated in 0.0.5 but was still reported. It is
now properly ignored.
Code like expect_equal(typeof(x), 'class')
was modified twice by
expect_identical_linter
and expect_type_linter
, which lead to a wrong
rewrite. It is now replaced by expect_type(x, 'class')
.
fix()
and lint()
now work correctly when several paths are passed.
fix_package()
and lint_package()
used all R files present from the root
path, even those in folders that are not typical of an R package.
fix_dir()
and fix_package()
now have the arguments force
and verbose
,
like fix()
.
rep_len_linter()
, sample_int_linter()
and
which_grepl_linter()
.fix()
and its variants would change some unstaged
files.update_flint()
now updates all rules and doesn't only add new rules anymore.condition_message_linter()
and expect_identical_linter()
.setup_flint()
now puts built-in rules in flint/rules/builtin
.expect_comparison_linter
and package_hooks_linter
.verbose
to lint_package()
and lint_dir()
.seq_linter
where seq_len(x)
is faster than seq(1, x)
.exclude_path
.flint
(#22).function_return_linter
and todo_comment_linter
.library_call_linter
.overwrite
to setup_flint_gha()
.redundant_equals_linter
.matrix_apply_linter
.absolute_path_linter
in default use as there are too many false
positives.unnecessary_nesting_linter
.lint()
and fix()
showing the number of files checked, lints
found and/or fixed.T
and F
in formulas.lengths_linter
if it was already present
in code.lintr
documentation in the manual pages.for_loop_index
,missing_argument
.fix()
has a new argument force
(FALSE
by default). This is useful if Git
was not detected, fix()
would modify several files, and it is run in a
non-interactive context. In this situation, set force = TRUE
to apply the
fixes anyway.cli
messages informing how many files are checked, and how many contain
lints (for lint_*
functions) or were modified (for fix_*
functions).length_test
linter.T
and F
in formulas (#33).absolute_path
, duplicate_argument
, empty_assignment
,
expect_length
, expect_not
, expect_null
, expect_true_false
,
expect_type
, literal_coercion
, nested_ifelse
, sort
,
undesirable_operator
.fix()
and its variants.fix()
on several files without using Git now opens an interactive
menu so that the user confirms they want to run fix()
. In case of
non-interactive use, this errors.# nolint
for compatibility with lintr
.New linters: expect_named
, numeric_leading_zero
, outer_negation
,
redundant_ifelse
, undesirable_function
, unreachable_code
.
fix_dir()
, fix_package()
, lint_dir()
, lint_package()
now have arguments
to exclude paths, linters, and use cache.
Removed browser
linter (it is now part of undesriable_function
).
Add support for a flint/config.yml
file that contains the list of linters
to use so that one doesn't need to constantly specify them in lint()
or fix()
.
x %in% class(y)
where x
is not a string as this is not
equivalent in some cases. Thanks Vincent Arel-Bundock for spotting this.