Skip to content

Commit 20136ae

Browse files
committed
chore: Update from '_rust/main' template
2 parents 0ebcb91 + 4d44cd7 commit 20136ae

13 files changed

Lines changed: 424 additions & 110 deletions

.clippy.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
msrv = "1.64.0" # MSRV
1+
msrv = "1.65.0" # MSRV
2+
warn-on-all-wildcard-imports = true
3+
allow-expect-in-tests = true
4+
allow-unwrap-in-tests = true
5+
allow-dbg-in-tests = true
6+
disallowed-methods = [
7+
{ path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
8+
{ path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
9+
{ path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
10+
{ path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
11+
{ path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" },
12+
{ path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" },
13+
]

.github/renovate.json5

Lines changed: 84 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,102 @@
11
{
2-
"schedule": [
3-
"before 3am on the first day of the month"
2+
schedule: [
3+
'before 3am on the first day of the month',
44
],
5-
"semanticCommits": "enabled",
6-
"configMigration": true,
7-
"packageRules": [
5+
semanticCommits: 'enabled',
6+
configMigration: true,
7+
dependencyDashboard: true,
8+
regexManagers: [
9+
{
10+
fileMatch: [
11+
'^rust-toolchain\\.toml$',
12+
'Cargo.toml$',
13+
'clippy.toml$',
14+
'\\.clippy.toml$',
15+
'^\\.github/workflows/ci.yml$',
16+
'^\\.github/workflows/rust-next.yml$',
17+
],
18+
matchStrings: [
19+
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
20+
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
21+
],
22+
depNameTemplate: 'rust',
23+
packageNameTemplate: 'rust-lang/rust',
24+
datasourceTemplate: 'github-releases',
25+
},
26+
],
27+
packageRules: [
28+
{
29+
commitMessageTopic: 'MSRV',
30+
matchManagers: [
31+
'regex',
32+
],
33+
matchPackageNames: [
34+
'rust',
35+
],
36+
minimumReleaseAge: "126 days", // 3 releases * 6 weeks per release * 7 days per week
37+
internalChecksFilter: "strict",
38+
},
839
// Goals:
940
// - Keep version reqs low, ignoring compatible normal/build dependencies
1041
// - Take advantage of latest dev-dependencies
1142
// - Rollup safe upgrades to reduce CI runner load
1243
// - Help keep number of versions down by always using latest breaking change
1344
// - Have lockfile and manifest in-sync
1445
{
15-
"matchManagers": ["cargo"],
16-
"matchDepTypes": ["build-dependencies", "dependencies"],
17-
"matchCurrentVersion": ">=0.1.0",
18-
"matchUpdateTypes": ["patch"],
19-
"enabled": false,
46+
matchManagers: [
47+
'cargo',
48+
],
49+
matchDepTypes: [
50+
'build-dependencies',
51+
'dependencies',
52+
],
53+
matchCurrentVersion: '>=0.1.0',
54+
matchUpdateTypes: [
55+
'patch',
56+
],
57+
enabled: false,
2058
},
2159
{
22-
"matchManagers": ["cargo"],
23-
"matchDepTypes": ["build-dependencies", "dependencies"],
24-
"matchCurrentVersion": ">=1.0.0",
25-
"matchUpdateTypes": ["minor"],
26-
"enabled": false,
60+
matchManagers: [
61+
'cargo',
62+
],
63+
matchDepTypes: [
64+
'build-dependencies',
65+
'dependencies',
66+
],
67+
matchCurrentVersion: '>=1.0.0',
68+
matchUpdateTypes: [
69+
'minor',
70+
],
71+
enabled: false,
2772
},
2873
{
29-
"matchManagers": ["cargo"],
30-
"matchDepTypes": ["dev-dependencies"],
31-
"matchCurrentVersion": ">=0.1.0",
32-
"matchUpdateTypes": ["patch"],
33-
"automerge": true,
34-
"groupName": "compatible (dev)",
74+
matchManagers: [
75+
'cargo',
76+
],
77+
matchDepTypes: [
78+
'dev-dependencies',
79+
],
80+
matchCurrentVersion: '>=0.1.0',
81+
matchUpdateTypes: [
82+
'patch',
83+
],
84+
automerge: true,
85+
groupName: 'compatible (dev)',
3586
},
3687
{
37-
"matchManagers": ["cargo"],
38-
"matchDepTypes": ["dev-dependencies"],
39-
"matchCurrentVersion": ">=1.0.0",
40-
"matchUpdateTypes": ["minor"],
41-
"automerge": true,
42-
"groupName": "compatible (dev)",
88+
matchManagers: [
89+
'cargo',
90+
],
91+
matchDepTypes: [
92+
'dev-dependencies',
93+
],
94+
matchCurrentVersion: '>=1.0.0',
95+
matchUpdateTypes: [
96+
'minor',
97+
],
98+
automerge: true,
99+
groupName: 'compatible (dev)',
43100
},
44101
],
45102
}

.github/settings.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22

33
repository:
44
description: "😱 Panic messages for humans."
5-
homepage: https://docs.rs/human-panic
6-
topics: rust cli panic-hook
5+
homepage: "https://docs.rs/human-panic"
6+
topics: "rust cli panic-hook"
77
has_issues: true
88
has_projects: false
99
has_wiki: false
1010
has_downloads: true
11-
default_branch: master
11+
default_branch: main
1212

13-
allow_squash_merge: true
13+
# Preference: people do clean commits
1414
allow_merge_commit: true
15-
allow_rebase_merge: true
15+
# Backup in case we need to clean up commits
16+
allow_squash_merge: true
17+
# Not really needed
18+
allow_rebase_merge: false
1619

1720
allow_auto_merge: true
1821
delete_branch_on_merge: true
@@ -25,22 +28,22 @@ labels:
2528
# Type
2629
- name: bug
2730
color: '#b60205'
28-
description: Not as expected
31+
description: "Not as expected"
2932
- name: enhancement
3033
color: '#1d76db'
31-
description: Improve the expected
34+
description: "Improve the expected"
3235
# Flavor
3336
- name: question
3437
color: "#cc317c"
35-
description: Uncertainty is involved
38+
description: "Uncertainty is involved"
3639
- name: breaking-change
3740
color: "#e99695"
3841
- name: good first issue
3942
color: '#c2e0c6'
40-
description: Help wanted!
43+
description: "Help wanted!"
4144

4245
branches:
43-
- name: master
46+
- name: main
4447
protection:
4548
required_pull_request_reviews: null
4649
required_conversation_resolution: true

.github/workflows/audit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ jobs:
4646
- uses: EmbarkStudios/cargo-deny-action@v1
4747
with:
4848
command: check ${{ matrix.checks }}
49+
rust-version: stable

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ jobs:
4949
- name: Test Release
5050
run: cargo test --release
5151
msrv:
52-
name: "Check MSRV: 1.64.0"
52+
name: "Check MSRV: 1.65.0"
5353
runs-on: ubuntu-latest
5454
steps:
5555
- name: Checkout repository
5656
uses: actions/checkout@v3
5757
- name: Install Rust
5858
uses: dtolnay/rust-toolchain@stable
5959
with:
60-
toolchain: 1.64.0 # MSRV
60+
toolchain: 1.65.0 # MSRV
6161
- uses: Swatinem/rust-cache@v2
62-
- name: No default features
63-
run: cargo check --workspace --all-targets --no-default-features
64-
- name: Debug
62+
- name: Default features
6563
run: cargo check --workspace --all-targets
64+
- name: No-default features
65+
run: cargo check --workspace --all-targets --no-default-features
6666
- name: Release
6767
run: cargo check --workspace --all-targets --release
6868
docs:
@@ -107,7 +107,7 @@ jobs:
107107
- name: Install Rust
108108
uses: dtolnay/rust-toolchain@stable
109109
with:
110-
toolchain: 1.64.0 # MSRV
110+
toolchain: 1.65.0 # MSRV
111111
components: clippy
112112
- uses: Swatinem/rust-cache@v2
113113
- name: Install SARIF tools
@@ -126,3 +126,5 @@ jobs:
126126
with:
127127
sarif_file: clippy-results.sarif
128128
wait-for-processing: true
129+
- name: Report status
130+
run: cargo clippy --workspace --all-targets -- -D warnings --allow deprecated

.github/workflows/rust-next.yml

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ permissions:
55

66
on:
77
schedule:
8-
- cron: '1 1 1 * *'
8+
- cron: '8 8 8 * *'
99

1010
env:
1111
RUST_BACKTRACE: 1
@@ -40,51 +40,3 @@ jobs:
4040
run: cargo test --no-run --release
4141
- name: Test Release
4242
run: cargo test --release
43-
rustfmt:
44-
name: rustfmt
45-
strategy:
46-
matrix:
47-
rust:
48-
- stable
49-
- beta
50-
continue-on-error: ${{ matrix.rust != 'stable' }}
51-
runs-on: ubuntu-latest
52-
steps:
53-
- name: Checkout repository
54-
uses: actions/checkout@v3
55-
- name: Install Rust
56-
uses: dtolnay/rust-toolchain@stable
57-
with:
58-
toolchain: ${{ matrix.rust }}
59-
components: rustfmt
60-
- uses: Swatinem/rust-cache@v2
61-
- name: Check formatting
62-
run: cargo fmt --all -- --check
63-
clippy:
64-
name: clippy
65-
runs-on: ubuntu-latest
66-
permissions:
67-
security-events: write # to upload sarif results
68-
steps:
69-
- name: Checkout repository
70-
uses: actions/checkout@v3
71-
- name: Install Rust
72-
uses: dtolnay/rust-toolchain@stable
73-
with:
74-
toolchain: stable
75-
components: clippy
76-
- uses: Swatinem/rust-cache@v2
77-
- name: Install SARIF tools
78-
run: cargo install clippy-sarif sarif-fmt
79-
- name: Check
80-
run: >
81-
cargo clippy --workspace --all-targets --message-format=json -- -D warnings --allow deprecated
82-
| clippy-sarif
83-
| tee clippy-results.sarif
84-
| sarif-fmt
85-
continue-on-error: true
86-
- name: Upload
87-
uses: github/codeql-action/upload-sarif@v2
88-
with:
89-
sarif_file: clippy-results.sarif
90-
wait-for-processing: true

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-yaml
66
stages: [commit]
@@ -15,12 +15,12 @@ repos:
1515
- id: detect-private-key
1616
stages: [commit]
1717
- repo: https://github.com/crate-ci/typos
18-
rev: v1.11.1
18+
rev: v1.14.10
1919
hooks:
2020
- id: typos
2121
stages: [commit]
2222
- repo: https://github.com/crate-ci/committed
23-
rev: v1.0.4
23+
rev: v1.0.17
2424
hooks:
2525
- id: committed
2626
stages: [commit-msg]

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing to human-panic
2+
3+
Thanks for wanting to contribute! There are many ways to contribute and we
4+
appreciate any level you're willing to do.
5+
6+
## Feature Requests
7+
8+
Need some new functionality to help? You can let us know by opening an
9+
[issue][new issue]. It's helpful to look through [all issues][all issues] in
10+
case its already being talked about.
11+
12+
## Bug Reports
13+
14+
Please let us know about what problems you run into, whether in behavior or
15+
ergonomics of API. You can do this by opening an [issue][new issue]. It's
16+
helpful to look through [all issues][all issues] in case its already being
17+
talked about.
18+
19+
## Pull Requests
20+
21+
Looking for an idea? Check our [issues][issues]. If it's look more open ended,
22+
it is probably best to post on the issue how you are thinking of resolving the
23+
issue so you can get feedback early in the process. We want you to be
24+
successful and it can be discouraging to find out a lot of re-work is needed.
25+
26+
Already have an idea? It might be good to first [create an issue][new issue]
27+
to propose it so we can make sure we are aligned and lower the risk of having
28+
to re-work some of it and the discouragement that goes along with that.
29+
30+
### Process
31+
32+
Before posting a PR, we request that the commit history get cleaned up.
33+
However, we recommend avoiding this during the review to make it easier to
34+
check how feedback was handled. Once the PR is ready, we'll ask you to clean up
35+
the commit history from the review. Once you let us know this is done, we can
36+
move forward with merging! If you are uncomfortable with these parts of git,
37+
let us know and we can help.
38+
39+
For commit messages, we use [Conventional](https://www.conventionalcommits.org)
40+
style. If you already wrote your commits and don't feel comfortable changing
41+
them, don't worry and go ahead and create your PR. We'll work with you on the
42+
best route forward. You can check your branch locally with
43+
[`committed`](https://github.com/crate-ci/committed).
44+
45+
As a heads up, we'll be running your PR through the following gauntlet:
46+
- warnings turned to compile errors
47+
- `cargo test`
48+
- `rustfmt`
49+
- `clippy`
50+
- `rustdoc`
51+
- [`committed`](https://github.com/crate-ci/committed)
52+
- [`typos`](https://github.com/crate-ci/typos)
53+
54+
## Releasing
55+
56+
Pre-requisites
57+
- Running `cargo login`
58+
- A member of `rust-cli:Maintainers`
59+
- Push permission to the repo
60+
- [`cargo-release`](https://github.com/crate-ci/cargo-release/)
61+
62+
When we're ready to release, a project owner should do the following
63+
1. Update the changelog (see `cargo release changes` for ideas)
64+
2. Determine what the next version is, according to semver
65+
3. Run [`cargo release -x <level>`](https://github.com/crate-ci/cargo-release)
66+
67+
[issues]: https://github.com/rust-cli/human-panic/issues
68+
[new issue]: https://github.com/rust-cli/human-panic/issues/new
69+
[all issues]: https://github.com/rust-cli/human-panic/issues?utf8=%E2%9C%93&q=is%3Aissue

0 commit comments

Comments
 (0)