Repository navigation
don't re-indent function declarations with scope < "indention" - #304
Conversation
Also reorganizing tests in new file.
Codecov Report
@@ Coverage Diff @@
## master #304 +/- ##
==========================================
- Coverage 91.18% 91.17% -0.02%
==========================================
Files 30 30
Lines 1373 1371 -2
==========================================
- Hits 1252 1250 -2
Misses 121 121
Continue to review full report at Codecov.
|
| update_indention_ref_fun_dec, | ||
| NULL | ||
| if (scope >= "indention") update_indention_ref_fun_dec, | ||
| identity |
There was a problem hiding this comment.
I'm not in love with the use of identity here, this sure doesn't help performance. Maybe allow NULL and filter out later with compact()? Need to use lst() instead of c().
The name for the list elements will be the full quoted expression, maybe change l. 138 above to wrap_if_else_multi_line_in_curly = if (strict) wrap_if_else_multi_line_in_curly else identity and likewise in other places?
There was a problem hiding this comment.
Ok, I like the idea with purrr::compact(), lst() and naming the arguments here and in other places.
and filter with purrr:::compact(). Requires breaking API change since initializer are now not a function anymore but a list of funcitons.
5a29c2b to
7e8b667
Compare
| ## Exported functions | ||
|
|
||
| create_style_guide(initialize = default_style_guide_attributes, line_break = NULL, space = NULL, token = NULL, indention = NULL, use_raw_indention = FALSE, reindention = tidyverse_reindention()) | ||
| create_style_guide(initialize = lst(default_style_guide_attributes), line_break = NULL, space = NULL, token = NULL, indention = NULL, use_raw_indention = FALSE, reindention = tidyverse_reindention()) |
There was a problem hiding this comment.
Should we use lst() as a default in an exported function at all?
|
Unfortunately, there was an inconsistency in |
and convert initialize internally to a list of one function.
|
It looks more natural to accept a function for the |
|
Ok, agree. |
1311158 to
0780c41
Compare
Closes #303