Skip to content

Commit d8283b0

Browse files
IndrajeetPatillorenzwalthertgithub-actions[bot]
authored
Restore token table alignment (#1018)
* Restore token table alignment * auto-update hooks * pre-commit * bump * update r hooks * swap start/stop * format with new styler version * pre-commit * bump Co-authored-by: Lorenz Walthert <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent b41f8ac commit d8283b0

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ default_language_version:
66

77
repos:
88
- repo: https://github.com/lorenzwalthert/precommit
9-
rev: v0.3.0
9+
rev: v0.3.2.9003
1010
hooks:
1111
- id: style-files
12-
args: ['--ignore-start="^# styler: on$"', '--ignore-stop="^# styler: off$"']
12+
args: ['--ignore-start="^# styler: off$"', '--ignore-stop="^# styler: on$"']
1313
exclude: >
1414
(?x)^(
1515
tests/testthat/.*/.*\.R(md|nw)?|
@@ -86,7 +86,7 @@ repos:
8686
tests/testthat/.*\.R(md)?
8787
)$
8888
- repo: https://github.com/pre-commit/pre-commit-hooks
89-
rev: v4.2.0
89+
rev: v4.3.0
9090
hooks:
9191
- id: check-added-large-files
9292
args: ['--maxkb=200']
@@ -102,7 +102,7 @@ repos:
102102
tests/testthat/_snaps/.*|
103103
)$
104104
- repo: https://github.com/lorenzwalthert/gitignore-tidy
105-
rev: 9dd648a2cbce0c0ce09255695b63ea4823699bec
105+
rev: a2260df7cc08de00d7312aeff68cea6bcba48c42
106106
hooks:
107107
- id: tidy-gitignore
108108
- repo: local

R/rules-line-breaks.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#' code(to = execute)
2323
#' })
2424
#' call2(
25-
#' x = 2,
26-
#' {
25+
#' x = 2, {
2726
#' code(to = execute)
2827
#' },
29-
#' c = { # this is the named case
28+
#' c = {
29+
#' # this is the named case
3030
#' g(x = 7)
3131
#' }
3232
#' )

R/token-define.R

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1+
# styler: off
12
token <- rbind.data.frame(
2-
c("&", "logical", "AND"),
3-
c("&&", "logical", "AND2"),
4-
c("|", "logical", "OR"),
5-
c("||", "logical", "OR2"),
6-
c(">", "logical", "GT"),
7-
c("<", "logical", "LT"),
8-
c("<=", "logical", "LE"),
9-
c(">=", "logical", "GE"),
10-
c("!=", "logical", "NE"),
11-
c("==", "logical", "EQ"),
12-
c("=", "assign_left", "EQ_SUB"),
13-
c("=", "assign_left", "EQ_ASSIGN"),
14-
c("<-", "assign_left", "LEFT_ASSIGN"),
15-
c("->", "assign_right", "RIGHT_ASSIGN"),
16-
c("+", "math", "'+'"),
17-
c("-", "math", "'-'"),
18-
c("*", "math", "'*'"),
19-
c("/", "math", "'/'"),
20-
c("^", "math", "'^'"),
21-
c("~", "formula", "'~'"),
22-
c("if", "cond", "IF"),
23-
c("else", "cond", "ELSE"),
24-
c("in", "loop_cond", "IN"),
25-
c("while", "loop_cond", "WHILE"),
3+
c("&", "logical", "AND"),
4+
c("&&", "logical", "AND2"),
5+
c("|", "logical", "OR"),
6+
c("||", "logical", "OR2"),
7+
c(">", "logical", "GT"),
8+
c("<", "logical", "LT"),
9+
c("<=", "logical", "LE"),
10+
c(">=", "logical", "GE"),
11+
c("!=", "logical", "NE"),
12+
c("==", "logical", "EQ"),
13+
c("=", "assign_left", "EQ_SUB"),
14+
c("=", "assign_left", "EQ_ASSIGN"),
15+
c("<-", "assign_left", "LEFT_ASSIGN"),
16+
c("->", "assign_right", "RIGHT_ASSIGN"),
17+
c("+", "math", "'+'"),
18+
c("-", "math", "'-'"),
19+
c("*", "math", "'*'"),
20+
c("/", "math", "'/'"),
21+
c("^", "math", "'^'"),
22+
c("~", "formula", "'~'"),
23+
c("if", "cond", "IF"),
24+
c("else", "cond", "ELSE"),
25+
c("in", "loop_cond", "IN"),
26+
c("while", "loop_cond", "WHILE"),
2627
stringsAsFactors = FALSE
2728
)
29+
# styler: on
2830

2931
colnames(token) <- c("text", "class", "token")
3032
math_token <- token$token[token$class == "math"]

man/set_line_break_before_curly_opening.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)