Skip to content

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

Merged
MichaelChirico merged 2 commits into
mainfrom
obj-name-str
Aug 4, 2023
Merged

MichaelChirico merged 2 commits into
mainfrom
obj-name-str

Conversation

@MichaelChirico

@MichaelChirico MichaelChirico commented Aug 4, 2023 •

Copy link
Copy Markdown
Collaborator

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

codecov-commenter commented Aug 4, 2023 •

Copy link
Copy Markdown

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