Skip to content
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

Fix some lints #2048

Merged
merged 2 commits into from
Aug 23, 2024
Merged

Fix some lints #2048

merged 2 commits into from
Aug 23, 2024

Conversation

etiennebacher
Copy link
Contributor

Hello, I'm building a new package to find and automatically fix lints in R code: flint.

I'm using real-life, large packages to check its performance (both in speed and in correctness of the fixes) and usethis is one of them. Since I already test on this, there's almost no additional cost for me in proposing those changes.

FYI, those changes were generated with flint::fix_package().

Most changes are trivial:

  • replace any(is.na()) by anyNA()
  • replace expect_identical(x, NULL) by expect_null(x)
    etc.

There's also likely a bug fix: length(old > 0) is replaced by length(old) > 0.

flint is quite new and linter rules are necessarily a bit opinionated (but I follow lintr most of the time), so some of those changes might not be to your taste, but I'd be happy to have some feedback on this.

Copy link
Member

@jennybc jennybc left a comment

Choose a reason for hiding this comment

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

Overall, the changes seem neutral to good and I agree this seems to have caught a bug.

I commented on one change that I don't love.

Thanks!

tests/testthat/test-utils-github.R Outdated Show resolved Hide resolved
@etiennebacher
Copy link
Contributor Author

Done, the pkgdown failure is unrelated

@jennybc
Copy link
Member

jennybc commented Aug 23, 2024

Thanks!

@jennybc jennybc merged commit 9aa221b into r-lib:main Aug 23, 2024
13 of 14 checks passed
@etiennebacher etiennebacher deleted the fix-some-lints branch August 24, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants