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

include rlang::int(1) and similar in literal_coercion_linter #1382

Closed
MichaelChirico opened this issue Jun 10, 2022 · 4 comments · Fixed by #1437
Closed

include rlang::int(1) and similar in literal_coercion_linter #1382

MichaelChirico opened this issue Jun 10, 2022 · 4 comments · Fixed by #1437
Labels
feature a feature request or enhancement good first issue ❤️ good issue for first-time contributors

Comments

@MichaelChirico
Copy link
Collaborator

rlang::int() is really meant to be a typed builder like c(1, 2, 3) with specified output type like

rlang::int(1, 3, 5) == c(1L, 3L, 5L)
rlang::chr("a", "b", "c") = c("a", "b", "c")

but if ...lengths() == 1, it seems reasonable to just use a literal instead.

@AshesITR AshesITR added feature a feature request or enhancement good first issue ❤️ good issue for first-time contributors labels Jun 13, 2022
@MichaelChirico
Copy link
Collaborator Author

hardly my first issue @AshesITR 😅

@AshesITR
Copy link
Collaborator

Oh, are you working on it?
I was thinking that may be an easy one for new contributors 😅

@MichaelChirico
Copy link
Collaborator Author

oh, i see. I thought label:help wanted ❤️ was for issues like that, and label:good first issue ❤️ is to demonstrate how to file good FR/bug reports.

@MichaelChirico
Copy link
Collaborator Author

(not currently working on it btw)

IndrajeetPatil added a commit that referenced this issue Jul 2, 2022
* include rlang functions in literal coersion

Closes #1382

* Update NEWS.md

* add a failing test for list2 construction

* fix test for rlang coercers ft. list2

* allow exp format scalar

* add failing tests

* fix tests

* also mention rlang coercer in docs

* Update NEWS.md

* tweak grammar

* simplify indentation

* DRY in xpaths

* different name for object

* consolidate both into one

* readability whitespace

Co-authored-by: Michael Chirico <chiricom@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement good first issue ❤️ good issue for first-time contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants