Skip to content

Commit b1902ec

Browse files
Merge bfa8309 into 9305b62
2 parents 9305b62 + bfa8309 commit b1902ec

File tree

126 files changed

+2216
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+2216
-290
lines changed

.Rbuildignore

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
^Meta$
2-
^doc$
1+
^.*-in_tree$
32
^.*\.Rproj$
4-
^\.Rproj\.user$
53
^API$
6-
^README\.Rmd$
4+
^CONTRIBUTING\.md$
5+
^LICENSE\.md$
6+
^Meta$
77
^README-.*\.png$
8-
^appveyor\.yml$
9-
^tic\.R$
10-
^docs$
11-
^_pkgdown\.yml$
12-
CONTRIBUTING.md
8+
^README\.Rmd$
9+
^\.Rproj\.user$
10+
^\.github$
1311
^\.gitsum$
14-
^gitsum$
15-
revdep
12+
^\.pre-commit-config\.yaml$
13+
^_pkgdown\.yml$
1614
^cran-comments\.md$
15+
^doc$
16+
^docs$
17+
^gitsum$
18+
^inst/WORDLIST$
19+
^inst/hooks/.*$
20+
^revdep$
1721
^tests/testmanual$
18-
^\.pre-commit-config\.yaml$
19-
^brew\-log$
20-
^\.github/$
22+
^tic\.R$
2123
^touchstone$
22-
^\.github$
23-
^LICENSE\.md$
24-
^inst/hooks/$
25-
^inst/WORDLIST$
24+
^vignettes/gsoc_proposal$

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
tests/testthat/**/*_tree linguist-generated=true
1+
tests/testthat/**/*_tree linguist-generated=true

.github/workflows/R-CMD-check.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616

1717
name: R-CMD-check
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref }}
21+
cancel-in-progress: true
22+
23+
1924
jobs:
2025
R-CMD-check:
2126
runs-on: ${{ matrix.config.os }}
@@ -27,9 +32,10 @@ jobs:
2732
matrix:
2833
config:
2934
- {os: macOS-latest, r: 'release'}
35+
- {os: windows-latest, r: 'devel'}
3036
- {os: windows-latest, r: 'release'}
31-
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
32-
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
37+
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
38+
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
3339
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3440
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3541
- {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}

.github/workflows/cancel.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/check-full.yaml

Whitespace-only changes.

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: master
3+
branches: main
44

55
name: pkgdown
66

.github/workflows/pre-commit.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: pre-commit
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'master'
6+
- 'main'
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-18.04
13+
if: >-
14+
!contains(github.event.head_commit.message, 'ci skip') &&
15+
(
16+
startsWith(github.ref, 'refs/heads') ||
17+
github.event.pull_request.draft == false
18+
)
19+
steps:
20+
- name: Cancel Previous Runs
21+
uses: styfle/[email protected]
22+
with:
23+
access_token: ${{ github.token }}
24+
- uses: actions/checkout@v2
25+
with:
26+
fetch-depth: 0
27+
- name: Install system dependencies
28+
if: runner.os == 'Linux'
29+
run: |
30+
# your system installation code here
31+
# sudo apt-get install -y libcurl4-openssl-dev
32+
- name: Set up Python
33+
uses: actions/setup-python@v2
34+
with:
35+
python-version: "3.9"
36+
architecture: "x64"
37+
- name: Run pre-commit
38+
uses: pre-commit/[email protected]
39+
- name: Commit files
40+
if: failure() && startsWith(github.ref, 'refs/heads')
41+
run: |
42+
if [[ `git status --porcelain --untracked-files=no` ]]; then
43+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
44+
git config --local user.name "github-actions[bot]"
45+
git checkout -- .github/workflows
46+
git commit -m "pre-commit" -a
47+
fi
48+
- name: Push changes
49+
if: failure() && startsWith(github.ref, 'refs/heads')
50+
uses: ad-m/github-push-action@master
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
branch: ${{ github.ref }}
54+
env:
55+
RENV_CONFIG_CACHE_ENABLED: FALSE

.github/workflows/test-coverage.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
on:
22
push:
33
branches:
4-
- master
4+
- main
55
pull_request:
66
branches:
7-
- master
7+
- main
88

99
name: test-coverage
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref }}
13+
cancel-in-progress: true
14+
15+
1116
jobs:
1217
test-coverage:
1318
runs-on: macOS-latest

.github/workflows/touchstone-comment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Continuous Benchmarks (Comment)
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref }}
5+
cancel-in-progress: true
6+
37
# read-write repo token
48
# access to secrets
59
on:

.github/workflows/touchstone-receive.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Continuous Benchmarks (Receive)
2+
concurrency:
3+
group: ${{ github.workflow }}-${{ github.head_ref }}
4+
cancel-in-progress: true
5+
26
on: pull_request
37
jobs:
48
prepare:

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
.RData
2+
.Rhistory
3+
.Rproj.user
4+
.gitsum
15
Meta
6+
R/scratch
27
doc
3-
.Rproj.user
4-
.Rhistory
5-
.RData
6-
inst/doc
78
docs
8-
.gitsum
99
gitsum
10-
R/scratch
10+
inst/doc
1111
revdep/
1212
!revdep/*.md
1313
!revdep/problems.md
1414
touchstone/*
15-
!touchstone/script.R
1615
!touchstone/config.json
16+
!touchstone/script.R

.pre-commit-config.yaml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@ default_stages: [commit]
44

55
repos:
66
- repo: https://github.com/lorenzwalthert/precommit
7-
rev: v0.1.3.9014
7+
rev: v0.2.2.9006
88
hooks:
99
- id: style-files
1010
args: [--style_pkg=styler, --style_fun=tidyverse_style]
1111
exclude: >
1212
(?x)^(
13-
tests/testthat/.*/.*\.R(md)?|
13+
tests/testthat/.*/.*\.R(md|nw)?|
1414
vignettes/customizing_styler\.Rmd|
1515
tests/testthat/public-api/xyzfile-rnw/random4\.Rnw|
16+
vignettes/detect-alignment\.Rmd|
17+
tests/testmanual/addins/.*invalid.*|
18+
tests/testmanual/addins/r-valid\.R|
1619
)$
1720
- id: roxygenize
21+
additional_dependencies:
22+
- r-lib/pkgapi
1823
- id: use-tidy-description
1924
- id: spell-check
2025
exclude: >
@@ -47,9 +52,11 @@ repos:
4752
exclude: >
4853
(?x)^(
4954
tests/testthat/public-api/xyzaddin/addin_region-.*|
50-
tests/testmanual/addins/r-invalid\.R|
55+
tests/.*invalid.*|
56+
tests/testthat/rmd/no-tidy-out\.Rmd|
5157
tests/testthat/escaping/basic-escape-out\.R|
52-
tests/testthat/indention_operators/base_pipe_and_assignment-.*|
58+
tests/testthat/indention_operators/.*pipe.*|
59+
tests/testthat/line_breaks_and_other/.*pipe.*|
5360
tests/testthat/exception_handling/parser-error.R|
5461
)$
5562
- id: no-browser-statement
@@ -58,25 +65,38 @@ repos:
5865
tests/testthat/public-api/xyzaddin/addin_region-.*|
5966
tests/testmanual/addins/r-invalid\.R|
6067
tests/testthat/escaping/basic-escape-out\.R|
61-
tests/testthat/indention_operators/base_pipe_and_assignment-.*|
68+
tests/testthat/indention_operators/.*pipe.*|
69+
tests/testthat/line_breaks_and_other/.*pipe.*|
6270
tests/testthat/exception_handling/parser-error.R|
6371
)$
6472
- id: deps-in-desc
6573
exclude: >
6674
(?x)^(
6775
touchstone/.*|
68-
tests/testmanual/addins/r-invalid\.R|
76+
tests/testmanual/addins/.*invalid.*|
6977
tests/testthat/escaping/basic-escape-out\.R|
7078
tests/testthat/rnw/011-conditional-eval-out\.Rnw|
7179
tests/testthat/.*\.R(md)?
7280
)$
7381
- repo: https://github.com/pre-commit/pre-commit-hooks
74-
rev: v4.0.1
82+
rev: v4.1.0
7583
hooks:
7684
- id: check-added-large-files
7785
args: ['--maxkb=200']
86+
- id: file-contents-sorter
87+
files: "\\.Rbuildignore$"
7888
- id: end-of-file-fixer
79-
exclude: '\.Rd'
89+
exclude: >
90+
(?x)^(
91+
\.Rd|
92+
tests/testthat/exception_handling/empty_file\.R|
93+
tests/testthat/parse_comments/eol_eof_spaces-.*|
94+
tests/testthat/reference-objects/.*|
95+
)$
96+
- repo: https://github.com/lorenzwalthert/gitignore-tidy
97+
rev: b3eaceb0bf2df137cc80f85b3943b6684f204c48
98+
hooks:
99+
- id: tidy-gitignore
80100
- repo: local
81101
hooks:
82102
- id: forbid-to-commit

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: styler
33
Title: Non-Invasive Pretty Printing of R Code
4-
Version: 1.6.2
4+
Version: 1.6.2.9000
55
Authors@R:
66
c(person(given = "Kirill",
77
family = "Müller",
@@ -16,8 +16,9 @@ Description: Pretty-prints R code without changing the user's formatting
1616
License: MIT + file LICENSE
1717
URL: https://github.com/r-lib/styler, https://styler.r-lib.org
1818
BugReports: https://github.com/r-lib/styler/issues
19+
Depends:
20+
R (>= 3.4.0)
1921
Imports:
20-
backports (>= 1.1.0),
2122
cli (>= 1.1.0),
2223
glue,
2324
magrittr (>= 2.0.0),
@@ -29,7 +30,6 @@ Imports:
2930
tibble (>= 1.4.2),
3031
tools,
3132
withr (>= 1.0.0),
32-
xfun (>= 0.1)
3333
Suggests:
3434
data.tree (>= 0.1.6),
3535
digest,
@@ -46,7 +46,7 @@ VignetteBuilder:
4646
Encoding: UTF-8
4747
Roxygen: list(markdown = TRUE, roclets = c("rd", "namespace", "collate",
4848
"pkgapi::api_roclet"))
49-
RoxygenNote: 7.1.1.9001
49+
RoxygenNote: 7.1.2
5050
Collate:
5151
'addins.R'
5252
'communicate.R'

NEWS.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,63 @@
1-
# styler 1.2
1+
# styler 1.6.2.9000 (Development version)
2+
3+
**API changes**
4+
5+
* new R option `styler.cache_root` (defaulting to `"styler"`) that determines
6+
the sub-directory under the {R.cache} cache directory that {styler} uses. Non-
7+
default caches won't be cleaned up by {styler}. We suggest `"styler-perm"`
8+
(also used by {precommit}).
9+
10+
* stylerignore markers are now interpreted as regular expressions instead of
11+
comments that must match exactly. This allows to specify multiple markers in
12+
one regular expression for `styler.ignore_start` and `styler.ignore_stop`,
13+
e.g. to use markers for lintr and styler on the same line, you can use
14+
`options(styler.ignore_start = "nolint start|styler: off"`:
15+
16+
```r
17+
# nolint start, styler: off
18+
1 +1
19+
# nolint end
20+
# styler: on
21+
```
22+
As a consequence of this approach, the defaults for `styler.ignore_start` and
23+
`styler.ignore_stop` omit the `#` (#849).
24+
25+
26+
**Other changes**
27+
28+
* `.onLoad()` method no longer broken with {cli} >= 3.1 (#893).
29+
* Piped function without brackets `substitute(x %>% y)` don't get `()` added
30+
anymore for one level deep (not more yet, see #889), as this can change
31+
outcome of the code (#876).
32+
* rules that add tokens don't break stylerignore sequences anymore (#891).
33+
* Add vignette on distributing style guide (#846, #861).
34+
* Alignment detection respects stylerignore (#850).
35+
* `Warning: Unknown or uninitialised column:` was fixed (#885).
36+
* Unaligned expressions with quoted key (e.g. `c("x" = 2)`) are now correctly
37+
detected (#881).
38+
* ensure a trailing blank line also if the input is cached (#867).
39+
* Preserve trailing blank line in roxygen examples to simplify concatenation of
40+
examples (#880).
41+
* added guarantee that styled code is parsable (#892).
42+
* An error is now thrown on styling if input unicode characters can't be
43+
correctly parsed for Windows and R < 4.2 (#883).
44+
* Fix argument name `filetype` in Example for `style_dir()` (#855).
45+
46+
47+
**Infrastructure**
48+
49+
* Remove dependency on {xfun} (#866).
50+
* Bump minimal R requirement to 3.4 in line with the
51+
[tidyverse](https://www.tidyverse.org/blog/2019/04/r-version-support/), which
52+
allowed to remove the dependency at {backports} and some exception handling.
53+
* rename default branch to main (#859).
54+
* the built package size has been reduced by ~50% by listing `*-in_tree` files
55+
in `.Rbuildignore` (#879).
56+
* Enable pre-commit.ci (#843).
57+
* use pre-commit via GitHub Actions (#872).
58+
* terminate running jobs on new push to save resources (#888).
59+
60+
# styler 1.6.2
261

362
* clean up cache files older than one week (#842).
463

0 commit comments

Comments
 (0)