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_linter #571

Closed
wants to merge 32 commits into from
Closed

box_usage_linter #571

wants to merge 32 commits into from

Conversation

radbasa
Copy link
Contributor

@radbasa radbasa commented Mar 7, 2024

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[...])
  • 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

TODO

  • roxygen docs
  • will need lots of QA for this (and test cases)

Packages

Local functions

  • handle S4 setMethod() attachment Will not do. box and S4 do not play well together.
  • handle box aliases

Box modules

  • handle file module box attachment

How to test

@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.26%. Comparing base (0ff3c44) to head (311de91).
Report is 18 commits behind head on main.

❗ Current head 311de91 differs from pull request most recent head 1172732. Consider uploading reports for the commit 1172732 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #571       +/-   ##
===========================================
+ Coverage   34.11%   59.26%   +25.14%     
===========================================
  Files          10       17        +7     
  Lines         554      896      +342     
===========================================
+ Hits          189      531      +342     
  Misses        365      365               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@radbasa
Copy link
Contributor Author

radbasa commented Mar 15, 2024

@jakubnowicki I added

  box::use(
    path/to/module1,
    path/to/module2[a, b, c],
    path/to/module3[...]
  )

to the test cases where it makes sense. All tests just worked as expected. When you have time, please take a look. It was a surprise for me.


expect_true(TRUE)
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add tests for lambda functions

(function (x) x + 1)(1)
{function (x,y) x+y}(2, 3)
(\(x) x+1)(1)

@radbasa radbasa mentioned this pull request Apr 24, 2024
36 tasks
@radbasa radbasa closed this May 20, 2024
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.

None yet

2 participants