Skip to content

Commit

Permalink
Upkeep (#104)
Browse files Browse the repository at this point in the history
* Bump R version
* `use_tidy_github_actions()`
* Use auto mode
* Rebrand
* Update license metadata
* Update COC
* Use pak
* Use `cli_abort()` for all errors
  • Loading branch information
hadley authored Oct 30, 2023
1 parent 9fabdc7 commit 321d77c
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 49 deletions.
44 changes: 22 additions & 22 deletions CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -21,25 +21,25 @@ community include:
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards
of acceptable behavior and will take appropriate and fair corrective action in
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Expand All @@ -50,16 +50,16 @@ decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies
when an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail
address, posting via an official social media account, or acting as an appointed
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [email protected].
reported to the community leaders responsible for enforcement at [email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down Expand Up @@ -114,13 +114,13 @@ community.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0,
available at <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
version 2.1, available at
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][https://github.com/mozilla/inclusion].

For answers to common questions about this code of conduct, see the FAQ at
<https://www.contributor-covenant.org/faq>. Translations are available at <https://www.contributor-covenant.org/translations>.

[homepage]: https://www.contributor-covenant.org
2 changes: 2 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: conflicted
Title: An Alternative Conflict Resolution Strategy
Version: 1.2.0.9000
Authors@R: c(
person("Hadley", "Wickham", , "hadley@rstudio.com", role = c("aut", "cre")),
person("RStudio", role = c("cph", "fnd"))
person("Hadley", "Wickham", , "hadley@posit.co", role = c("aut", "cre")),
person("Posit Software, PBC", role = c("cph", "fnd"))
)
Description: R's default conflict management system gives the most
recently loaded package precedence. This can make it hard to detect
Expand All @@ -15,7 +15,7 @@ License: MIT + file LICENSE
URL: https://conflicted.r-lib.org/, https://github.com/r-lib/conflicted
BugReports: https://github.com/r-lib/conflicted/issues
Depends:
R (>= 3.2)
R (>= 3.6)
Imports:
cli (>= 3.4.0),
memoise,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2020
YEAR: 2023
COPYRIGHT HOLDER: conflicted authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2020 conflicted authors
Copyright (c) 2023 conflicted authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions R/shim.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ package_name <- function(package, character.only = FALSE) {
}

if (!is.character(package) || length(package) != 1L) {
abort("`package` must be character vector of length 1.")
cli::cli_abort("{.arg package} must be character vector of length 1.")
}
if (is.na(package) || (package == "")) {
abort("`package` must not be NA or ''.")
cli::cli_abort("{.arg package} must not be NA or ''.")
}

package
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Thanks to [\@krlmlr](https://github.com/krlmlr) for this neat idea! This code wa
## Installation

```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("r-lib/conflicted")
# install.packages("pak")
pak::pak("r-lib/conflicted")
```

## Usage
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ package.
## Installation

``` r
# install.packages("devtools")
devtools::install_github("r-lib/conflicted")
# install.packages("pak")
pak::pak("r-lib/conflicted")
```

## Usage
Expand Down Expand Up @@ -81,8 +81,7 @@ You can ask conflicted to report any conflicts in the current session:

``` r
conflict_scout()
#> 2 conflicts
#> • `filter()`: dplyr
#> 1 conflict
#> • `lag()`: dplyr and stats
```

Expand Down
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ template:
includes:
in_header: |
<script defer data-domain="conflicted.r-lib.org,all.tidyverse.org" src="https://plausible.io/js/plausible.js"></script>
development:
mode: auto
4 changes: 2 additions & 2 deletions man/conflicted-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions tests/testthat/_snaps/shim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# package_name throws errors with invalid names

Code
package_name_(c("x", "y"))
Condition
Error in `package_name()`:
! `package` must be character vector of length 1.
Code
package_name_(1:10)
Condition
Error in `package_name()`:
! `package` must be character vector of length 1.
Code
package_name_(NA_character_)
Condition
Error in `package_name()`:
! `package` must not be NA or ''.
Code
package_name_("")
Condition
Error in `package_name()`:
! `package` must not be NA or ''.

21 changes: 10 additions & 11 deletions tests/testthat/test-shim.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ test_that("package_name mimics library", {
})

test_that("package_name throws errors with invalid names" ,{
x <- c("x", "y")
expect_error(package_name(quo(x), TRUE), "character vector")

x <- 1:10
expect_error(package_name(quo(x), TRUE), "character vector")

x <- NA_character_
expect_error(package_name(quo(x), TRUE), "NA")

x <- ""
expect_error(package_name(quo(x), TRUE), "''")
package_name_ <- function(x) {
package_name(quo(x), character.only = TRUE)
}

expect_snapshot(error = TRUE, {
package_name_(c("x", "y"))
package_name_(1:10)
package_name_(NA_character_)
package_name_("")
})
})

0 comments on commit 321d77c

Please sign in to comment.