Skip to content

Remove excess nesting - #2326

Closed
MichaelChirico wants to merge 1 commit into
mainfrom
unnest
Closed

MichaelChirico wants to merge 1 commit into
mainfrom
unnest

Conversation

@MichaelChirico

@MichaelChirico MichaelChirico commented Nov 21, 2023 •

Copy link
Copy Markdown
Collaborator

Caught by #2302. Follow-up to #2303. Missed before as it got mixed in with allow_assignment = TRUE false positives.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0815b2a) 99.39% compared to head (6decdb7) 99.39%.

❗ Current head 6decdb7 differs from pull request most recent head 2bfec0d. Consider uploading reports for the commit 2bfec0d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2326   +/-   ##
=======================================
  Coverage   99.39%   99.39%           
=======================================
  Files         121      121           
  Lines        5461     5461           
=======================================
  Hits         5428     5428           
  Misses         33       33           

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

@AshesITR AshesITR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this actually improves readability. Note the parallelism between patrick::with_parameters_test_that() and testthat::test_that().

@MichaelChirico

Copy link
Copy Markdown
Collaborator Author

I'm not sure this actually improves readability. Note the parallelism between patrick::with_parameters_test_that() and testthat::test_that().

difference is test_that() is usually like

test_that("descr", {
  ...
})

vs. because of the parameter arguments with_parameters_test_that is usually like

with_parameters_test_that(
  "descr",
  {
    ...
  },
  ...
)

@AshesITR

Copy link
Copy Markdown
Collaborator

Yes and that highlights the actual test code very well.

@IndrajeetPatil

Copy link
Copy Markdown
Contributor

I agree with @AshesITR here—the braced expressions does highlight the test code and draws a parallel with testthat.

Is this really flagged as excessive nesting by the new linter?

@AshesITR

Copy link
Copy Markdown
Collaborator

I can see a similar problem occur with shiny.
reactive({}), observe({}), observeEvent(., {}) and render*({}) can potentially cause unwanted lints.

@MichaelChirico

Copy link
Copy Markdown
Collaborator Author

Let's discuss exceptions needed in #2302 or its follow-ups. test_that() also lacks any exception at the moment.

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.

4 participants