Skip to content

Commit b8f7359

Browse files
Merge c2e25f9 into 9305b62
2 parents 9305b62 + c2e25f9 commit b8f7359

File tree

79 files changed

+793
-175
lines changed

Some content is hidden

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

79 files changed

+793
-175
lines changed

.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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ jobs:
2727
matrix:
2828
config:
2929
- {os: macOS-latest, r: 'release'}
30+
- {os: windows-latest, r: 'devel'}
3031
- {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" }
32+
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
33+
- {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" }
3334
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3435
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3536
- {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}

.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/cancel-workflow-action@0.6.0
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.8"
36+
architecture: "x64"
37+
- name: Run pre-commit
38+
uses: pre-commit/action@v2.0.3
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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

.pre-commit-config.yaml

Lines changed: 19 additions & 6 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.1.3.9139
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: >
@@ -49,7 +54,8 @@ repos:
4954
tests/testthat/public-api/xyzaddin/addin_region-.*|
5055
tests/testmanual/addins/r-invalid\.R|
5156
tests/testthat/escaping/basic-escape-out\.R|
52-
tests/testthat/indention_operators/base_pipe_and_assignment-.*|
57+
tests/testthat/indention_operators/.*pipe.*|
58+
tests/testthat/line_breaks_and_other/.*pipe.*|
5359
tests/testthat/exception_handling/parser-error.R|
5460
)$
5561
- id: no-browser-statement
@@ -58,14 +64,15 @@ repos:
5864
tests/testthat/public-api/xyzaddin/addin_region-.*|
5965
tests/testmanual/addins/r-invalid\.R|
6066
tests/testthat/escaping/basic-escape-out\.R|
61-
tests/testthat/indention_operators/base_pipe_and_assignment-.*|
67+
tests/testthat/indention_operators/.*pipe.*|
68+
tests/testthat/line_breaks_and_other/.*pipe.*|
6269
tests/testthat/exception_handling/parser-error.R|
6370
)$
6471
- id: deps-in-desc
6572
exclude: >
6673
(?x)^(
6774
touchstone/.*|
68-
tests/testmanual/addins/r-invalid\.R|
75+
tests/testmanual/addins/.*invalid.*|
6976
tests/testthat/escaping/basic-escape-out\.R|
7077
tests/testthat/rnw/011-conditional-eval-out\.Rnw|
7178
tests/testthat/.*\.R(md)?
@@ -76,7 +83,13 @@ repos:
7683
- id: check-added-large-files
7784
args: ['--maxkb=200']
7885
- id: end-of-file-fixer
79-
exclude: '\.Rd'
86+
exclude: >
87+
(?x)^(
88+
\.Rd|
89+
tests/testthat/exception_handling/empty_file\.R|
90+
tests/testthat/parse_comments/eol_eof_spaces-.*|
91+
tests/testthat/reference-objects/.*|
92+
)$
8093
- repo: local
8194
hooks:
8295
- 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: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1-
# styler 1.2
1+
# styler 1.6.2.9000 (Development version)
2+
3+
* Piped function without brackets `substitute(x %>% y)` don't get `()` added
4+
anymore, as this can change outcome of the code (#876).
5+
* Alignment detection respects stylerignore (#850).
6+
* Add vignette on distributing style guide (#846, #861).
7+
* Enable pre-commit.ci (#843).
8+
* new R option `styler.cache_root` (defaulting to `"styler"`) that determines
9+
the sub-directory under the {R.cache} cache directory that {styler} uses. Non-
10+
default caches won't be cleaned up by {styler}. We suggest `"styler-perm"`
11+
(also used by {precommit}).
12+
* rename default branch to main (#859).
13+
* Fix argument name `filetype` in Example for `style_dir()` (#855).
14+
* ensure a trailing blank line also if the input is cached (#867).
15+
* Bump minimal R requirement to 3.4 in line with the [tidyverse](https://www.tidyverse.org/blog/2019/04/r-version-support/), which
16+
allowed to remove the dependency at {backports} and some exception handling.
17+
* Remove dependency on {xfun} (#866).
18+
* use pre-commit via GitHub Actions (#872).
19+
20+
* stylerignore markers are now interpreted as regular expressions instead of
21+
comments that must match exactly. This allows to specify multiple markers in
22+
one regular expression for `styler.ignore_start` and `styler.ignore_stop`,
23+
e.g. to use markers for lintr and styler on the same line, you can use
24+
`options(styler.ignore_start = "nolint start|styler: off"`:
25+
26+
```r
27+
# nolint start, styler: off
28+
1 +1
29+
# nolint end
30+
# styler: on
31+
```
32+
As a consequence of this approach, the defaults for `styler.ignore_start` and
33+
`styler.ignore_stop` omit the `#` (#849).
34+
35+
36+
# styler 1.6.2
237

338
* clean up cache files older than one week (#842).
439

R/addins.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#' Helper functions for styling via RStudio Addins.
44
#' @section Addins:
55
#' - Set style: Select the style transformers to use. For flexibility, the user
6-
#' input is passed to the `transformers` argument, not the `style` argument, so
7-
#' entering `styler::tidyverse_style(scope = "spaces")` in the Addin is
6+
#' input is passed to the `transformers` argument, not the `style` argument,
7+
#' so entering `styler::tidyverse_style(scope = "spaces")` in the Addin is
88
#' equivalent to `styler::style_text("1+1", scope = "spaces")` and
99
#' `styler::style_text("1+1", transformers = styler::tidyverse_style(scope = "spaces"))`
1010
#' if the text to style is `1+1`. The style transformers are memorized

0 commit comments

Comments
 (0)