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

box_usage_linters for packages #9

Merged
merged 16 commits into from
May 15, 2024
Merged

box_usage_linters for packages #9

merged 16 commits into from
May 15, 2024

Conversation

radbasa
Copy link
Collaborator

@radbasa radbasa commented Apr 25, 2024

extends from PR #8

Changes

Packages

  • lints on function not attached
  • lints on package$function not exists
  • lints on attached function unused
  • lints on attached package unused
  • lints on invalid function from package box::use(shiny[no_func])
  • handles box::use(package[function])
  • handles box::use(package)
  • handles box::use(package[...])
  • handles aliased package functions and aliased packages
  • is aware of base packages

Local functions

  • lints on declared function unused - may have to remove this. our box modules are libraries of function declarations!
  • handles functions declared in source file
  • handles internal R6 class object calls

Box modules

How to test

Definition of Done

  • The change is thoroughly documented.
  • The CI passes (R CMD check, linter, unit tests, spelling).
  • Any generated files have been updated (e.g. .Rd files with roxygen2::roxygenise())

@radbasa radbasa changed the title CI test CI test runner Apr 26, 2024
@radbasa radbasa marked this pull request as draft April 26, 2024 07:25
@radbasa radbasa changed the title CI test runner box_usage_linters for packages Apr 26, 2024
@radbasa radbasa marked this pull request as ready for review April 29, 2024 11:17
@radbasa radbasa mentioned this pull request Apr 29, 2024
3 tasks
@radbasa radbasa requested a review from jakubnowicki May 3, 2024 08:33
Base automatically changed from rhino-default-linters to main May 14, 2024 12:47
Copy link
Member

@jakubnowicki jakubnowicki left a comment

Choose a reason for hiding this comment

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

LGTM

@jakubnowicki
Copy link
Member

I'm not sure how to handle this, but dplyr::desc does not need to be declared in import to work:

box::use(
  dplyr[arrange],
)

mtcars |>
  arrange(desc(mpg))

This will run without any problems...

@radbasa
Copy link
Collaborator Author

radbasa commented May 15, 2024

I'm not sure how to handle this, but dplyr::desc does not need to be declared in import to work:

box::use(
  dplyr[arrange],
)

mtcars |>
  arrange(desc(mpg))

This will run without any problems...

Screenshot 2024-05-15 at 1 42 10 PM

lintr::lint("test.R", linters = box.linters::box_usage_linter())

Screenshot 2024-05-15 at 1 43 52 PM

@radbasa radbasa merged commit 6d78630 into main May 15, 2024
5 checks passed
@radbasa radbasa deleted the box-usage-linter branch May 15, 2024 05:49
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