-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.styler.R
More file actions
36 lines (28 loc) · 879 Bytes
/
Copy path.styler.R
File metadata and controls
36 lines (28 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Configuration for styler
# This configuration follows Bioconductor style guidelines
# Use tidyverse style as base
style_transformers <- styler::tidyverse_style(
# Indentation
indent_by = 2,
# Spacing
strict = TRUE,
# Line breaks
math_token_spacing = styler::specify_math_token_spacing(
zero = c("'^'", "'/'", "'*'", "'+'"),
one = c("'-'", "'='", "'~'", "'<'", "'>'", "'<='", "'>='", "'&'", "'|'", "'=='", "'!='")
),
# Always use explicit returns
reindention = styler::specify_reindention(
regex_pattern = NULL,
indention = 0,
comments_only = TRUE
),
# Comments
scope = "tokens"
)
# Ensure each file ends with a newline
style_transformers$line_break$add_line_break_after_source <- TRUE
# Never use tabs, always use spaces
style_transformers$indention$indent_character <- " "
# Return the transformer
style_transformers