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

Don't lint nested string literals on LHS of assignment #2038

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

MichaelChirico
Copy link
Collaborator

@MichaelChirico MichaelChirico commented Aug 4, 2023

Closes #1466

There's a few different ways we could fix this. I think it would also be enough to look for nearby SYMBOL_FUNCTION_CALL.

I also think we can skip the LBB test for STR_CONST, but didn't bother looking too carefully for this PR.

NB: relevant test cases like {a,"a"}${b,"b"} <- 1 are already present in the suite:

expect_lint("good_name$\"badName\" <- 42", NULL, linter)
expect_lint("good_name$'badName' <- 42", NULL, linter)
expect_lint("badName$\"good_name\" <- 42", lint_msg, linter)
expect_lint("badName$'good_name' <- 42", lint_msg, linter)
expect_lint("`badName`$\"good_name\" <- 42", lint_msg, linter)
expect_lint("`badName`$'good_name' <- 42", lint_msg, linter)

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2023

Codecov Report

Merging #2038 (ade6443) into main (239de20) will not change coverage.
The diff coverage is n/a.

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

@@           Coverage Diff           @@
##             main    #2038   +/-   ##
=======================================
  Coverage   98.56%   98.56%           
=======================================
  Files         114      114           
  Lines        5013     5013           
=======================================
  Hits         4941     4941           
  Misses         72       72           
Files Changed Coverage Δ
R/object_name_linter.R 98.18% <ø> (ø)

@MichaelChirico MichaelChirico merged commit bb7669a into main Aug 4, 2023
@MichaelChirico MichaelChirico deleted the obj-name-str branch August 4, 2023 14:39
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.

More glue fails and sneak case
3 participants