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

Make styler ignore work when tokens are modified #602

merged 8 commits into from Feb 18, 2020


Copy link

Closes #599.

… a stylerignore sequence.

Previously, all non-terminals were set to FALSE. This new implementation is required when creating new tokens (e.g. wrap_expr_in_curly()) and we don't want to make assumptions about the structure of the child to find out whether it's stylerignore or not. Hence, we can just check if the tokens to wrap are stylerignore or not, no matter whether or not they are terminals.
Do apply stylerignore based on the pos_id of the first token in the sequence (the start marker) and not 1:1 for every token in the stylerignore sequence. The latter would not work if tokens are added or removed.
Copy link

codecov-io commented Feb 18, 2020

Codecov Report

Merging #602 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #602      +/-   ##
+ Coverage   92.12%   92.18%   +0.05%     
  Files          47       47              
  Lines        2096     2110      +14     
+ Hits         1931     1945      +14     
  Misses        165      165
Impacted Files Coverage Δ
R/stylerignore.R 100% <100%> (ø) ⬆️
R/token-create.R 95.91% <100%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b607e68...c63dced. Read the comment docs.

@lorenzwalthert lorenzwalthert merged commit 06b4eae into r-lib:master Feb 18, 2020
@lorenzwalthert lorenzwalthert deleted the issue-599 branch February 18, 2020 15:48
@lorenzwalthert lorenzwalthert restored the issue-599 branch November 28, 2020 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

styler ignore works improperly when tokens are added or removed
2 participants