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

[CRITICAL BUG] Skip styling if no box::use() is found #138

Merged
merged 9 commits into from
Aug 28, 2024

Conversation

radbasa
Copy link
Collaborator

@radbasa radbasa commented Aug 22, 2024

Have you read the Contributing Guidelines?

Issue #134

Includes a bugfix for R >= 4.3 compatibility. See comments below.

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 requested a review from jakubnowicki August 22, 2024 10:12
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Project coverage is 96.71%. Comparing base (e736931) to head (4339f61).
Report is 1 commits behind head on main.

Files Patch % Lines
R/namespaced_function_calls.R 0.00% 3 Missing ⚠️
R/zzz.R 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
- Coverage   97.21%   96.71%   -0.51%     
==========================================
  Files          23       24       +1     
  Lines        1114     1125      +11     
==========================================
+ Hits         1083     1088       +5     
- Misses         31       37       +6     

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

R/zzz.R Outdated
Comment on lines 28 to 32
namespaced_function_calls = if (getRversion() >= 4.3) {
namespaced_function_calls()
} else {
NULL
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason, installing box.linters 0.10.3 from CRAN has a different result from devtools::install_local(). If treesitter is not installed, namespaced_function_calls() remains active despite the !is_treesitter_installed() check inside namespaced_function_calls().

I decided to perform the R version check here, instead of inside namespaced_function_calls() because it probably won't work there just like how !is_treesitter_installed() is not working now.

Comment on lines +49 to +53
return(
lintr::Linter(function(source_expression) {
return(list())
})
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Saw some warnings about starting lintr 3.0.0 all linter configs should return a function. Returning an empty linter function here.

@radbasa
Copy link
Collaborator Author

radbasa commented Aug 27, 2024

Hold on this. Previous CI failed. CI could not properly handle the R version check.

CI good now. R CMD check on CI did not like getRversion().

@@ -1,3 +1,7 @@
# box.linters (development version)

* Fix critical bug of style_box_use_*() converting all lines to NA if there is no `box::use()` call found.
Copy link
Member

Choose a reason for hiding this comment

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

Please add the R version fix to the changelog.

@radbasa radbasa merged commit f766290 into main Aug 28, 2024
5 of 7 checks passed
@radbasa radbasa deleted the no-box-style-nothing branch August 28, 2024 10:56
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