Skip to content

finer-tuned handling of ambiguous XML nodes for infix operators #2115

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

Merged
merged 11 commits into from
Sep 8, 2023

Conversation

MichaelChirico
Copy link
Collaborator

Towards #1977. This is sort of a breaking change, though it doesn't affect any defaults, but I think the new behavior is much cleaner.

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2023

Codecov Report

Merging #2115 (d83abb4) into main (dd445d8) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##             main    #2115      +/-   ##
==========================================
- Coverage   99.65%   99.65%   -0.01%     
==========================================
  Files         120      120              
  Lines        5242     5231      -11     
==========================================
- Hits         5224     5213      -11     
  Misses         18       18              
Files Changed Coverage Δ
R/shared_constants.R 93.54% <ø> (ø)
R/infix_spaces_linter.R 100.00% <100.00%> (ø)
R/undesirable_operator_linter.R 100.00% <100.00%> (ø)

operator_nodes <- undesirable_operator_metadata$xml_tag[included_operators]
needs_exact_string <- !is.na(undesirable_operator_metadata$exact_string_value[included_operators])
needs_exact_string <- operator_nodes %in% infix_metadata$xml_tag[infix_metadata$ambiguous_node]
operator_nodes[needs_exact_string] <- sprintf(
"%s[text() = '%s']",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This snippet could be refactored into infix_metadata (xml_token?) to avoid duplication.

@MichaelChirico
Copy link
Collaborator Author

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.

3 participants