Repository navigation
Granular scope selection - #705
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #705 +/- ##
==========================================
+ Coverage 90.43% 90.47% +0.03%
==========================================
Files 47 47
Lines 2248 2257 +9
==========================================
+ Hits 2033 2042 +9
Misses 215 215
Continue to review full report at Codecov.
|
Not currently trying to decouple further (moving indention rules before update_indention_ref_fun_dec() in the transformers$indention, where one might think they belong from a conceptupal point of view instead of transformers$spaces as there might be unanticipated dependencies)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #703.
Context: When
use_raw_indentionisTRUE(which it is whenscope < 'indention'prior to this PR), the number of spaces between tokens on different lines is applied after the line break to restore initial indention. For that reason, spaces between tokens on different lines must not be modified in any case, otherwisescope < 'indention'would not work properly anymore. You can see that pretty much all transformers underR/rules-spacing.Rdon't modifyspaceswithout checking fornewlines == 0L. Indention is tracked separately in the columnindentionand then applied at the end withchoose_indention()ifuse_raw_indentionisFALSE, otherwise,lag_spacesis used.For some reason not obvious to me at this moment, all indention transformers were grouped under the space transformers in
tidyverse_styleat the beginning, exceptupdate_indention_ref_fun_dec()is listed underindentiontransformers (probably because it must come after all spacing rules). However, one could try to move all indention rules from the spaces transformers beforeupdate_indention_ref_fun_dec()and see if things pass.Also, these rules live in
R/indent.R, and notR/rules-indention.R(which does not exist), where they should be for consistency with other rules like spacing (butR/rules-replacment.RandR/rules-other.Ris also not consistent...).These concerns were addressed in #707.