Skip to content

Addresses handling of native pipe args with no placeholder - #11194

Merged
kevinushey merged 1 commit into
mainfrom
enhancement/native_pipe_check_args
May 13, 2022
Merged

kevinushey merged 1 commit into
mainfrom
enhancement/native_pipe_check_args

Conversation

@jgutman

@jgutman jgutman commented May 12, 2022

Copy link
Copy Markdown
Contributor

Intent

Addresses #10124

Approach

Do the same thing we do with the magrittr pipe, i.e. 1) update isPipeOperator to recognize |> as a valid pipe, 2) add to the list of unnamed arguments only if magrittr pipe is used without . or native pipe is used without _

Automated Tests

Small tweaks to automated tests for isPipeOperator regex.

QA Notes

With diagnostics turned on for "Check arguments to R function calls"

c(1,2,3) %% length()            # EXPECTED: warning (missing arg, because not a pipe)
c(1,2,3) %>% length()          # EXPECTED: no warning
c(1,2,3) %>% length(.)         # EXPECTED: no warning
c(1,2,3) |> length(_)              # EXPECTED: no warning
c(1,2,3) |> length()                # EXPECTED: no warning
c(1,2,3) |> cor(y = c(1,2,3))  # EXPECTED: no warning
cor(y = c(1,2,3))                    # EXPECTED: warning (missing arg)
length()                                  # EXPECTED: warning (missing arg)
c(1,2,3) |> length(.)               # EXPECTED: error (too many args, incompatible placeholder)

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

@kevinushey kevinushey 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.

LGTM!

@kevinushey
kevinushey merged commit d8c278b into main May 13, 2022
@kevinushey
kevinushey deleted the enhancement/native_pipe_check_args branch May 13, 2022 05:47
matheustavaresdev added a commit that referenced this pull request May 17, 2022
…on-auto-select

* 'main' of github.com:rstudio/rstudio: (40 commits)
  update to Electron 18.2.3
  ensure new instance is created when opening remote session file
  Update NEWS.md
  Fix flags not being passed through constructor in R version selectors
  remove unnecessary package
  install gpg1 for signing
  skip adding compiler definitions
  find jdk on my Intel Mac
  produce builds for fedora36
  use ucrtbase.dll with R 4.2.0 or newer (#11207)
  Outline uses quarto style labels, `#| label: <name>` (#11192)
  Allow fallback unknown text file types to open in Desktop same as in server
  update embedded libclang to 13.0.1 (#11186)
  Addresses handling of native pipe args with no placeholder (#11194)
  New project fails earlier when directory already exist (#11191)
  remove unused gwt class replacements (#11193)
  update Electron NEWS
  make message box API aware of this option
  whitespace tweak
  naming tweaks from PR feedback
  ...
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