Skip to content

New pipe_return_linter - #2299

Merged
IndrajeetPatil merged 6 commits into
mainfrom
pipe_return
Nov 19, 2023
Merged

IndrajeetPatil merged 6 commits into
mainfrom
pipe_return

Conversation

@MichaelChirico

Copy link
Copy Markdown
Collaborator

Part of #884

No hits on {lintr}.

@codecov-commenter

codecov-commenter commented Nov 17, 2023 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9920110) 99.40% compared to head (b5daff7) 99.40%.

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2299   +/-   ##
=======================================
  Coverage   99.40%   99.40%           
=======================================
  Files         117      117           
  Lines        5334     5334           
=======================================
  Hits         5302     5302           
  Misses         32       32           

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

Comment thread R/pipe_return_linter.R Resolved
expect_lint(nested_return_lines, NULL, linter)
})

test_that("pipe_return_linter blocks simple disallowed usages", {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also checked this for lambdas and it works as expected. But I don't think we need to add tests for that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

what do you mean by lambdas in this case? |>? see the comment in the R/ script -- native pipe is excluded because using return() there is a parser error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, I meant with purrr's mappers :)

@IndrajeetPatil
IndrajeetPatil merged commit 0aefa5f into main Nov 19, 2023
@IndrajeetPatil
IndrajeetPatil deleted the pipe_return branch November 19, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants