Skip to content

Commit b867566

Browse files
authored
Merge pull request #391 from epage/template
chore: Update from _rust/main template
2 parents 697d9fe + a674796 commit b867566

File tree

15 files changed

+59
-77
lines changed

15 files changed

+59
-77
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[resolver]
2+
incompatible-rust-versions = "fallback"

.github/renovate.json5

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
customManagers: [
1010
{
1111
customType: 'regex',
12-
fileMatch: [
13-
'^rust-toolchain\\.toml$',
14-
'Cargo.toml$',
15-
'clippy.toml$',
16-
'\\.clippy.toml$',
17-
'^\\.github/workflows/ci.yml$',
18-
'^\\.github/workflows/rust-next.yml$',
12+
managerFilePatterns: [
13+
'/^rust-toolchain\\.toml$/',
14+
'/Cargo.toml$/',
15+
'/clippy.toml$/',
16+
'/\\.clippy.toml$/',
17+
'/^\\.github/workflows/ci.yml$/',
18+
'/^\\.github/workflows/rust-next.yml$/',
1919
],
2020
matchStrings: [
2121
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',

.github/workflows/ci.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,11 @@ jobs:
4646
with:
4747
toolchain: ${{ matrix.rust }}
4848
- uses: Swatinem/rust-cache@v2
49+
- uses: taiki-e/install-action@cargo-hack
4950
- name: Build
50-
run: cargo test --no-run --workspace --all-features
51-
- name: Default features
52-
run: cargo test --workspace
53-
- name: All features
54-
run: cargo test --workspace --all-features
55-
- name: No-default features
56-
run: cargo test --workspace --no-default-features
51+
run: cargo test --workspace --no-run
52+
- name: Test
53+
run: cargo hack test --each-feature --workspace
5754
msrv:
5855
name: "Check MSRV"
5956
runs-on: ubuntu-latest
@@ -67,11 +64,7 @@ jobs:
6764
- uses: Swatinem/rust-cache@v2
6865
- uses: taiki-e/install-action@cargo-hack
6966
- name: Default features
70-
run: cargo hack check --locked --rust-version --ignore-private --workspace --all-targets
71-
- name: All features
72-
run: cargo hack check --all-features --locked --rust-version --ignore-private --workspace --all-targets
73-
- name: No-default features
74-
run: cargo hack check --no-default-features --locked --rust-version --ignore-private --workspace --all-targets
67+
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going
7568
minimal-versions:
7669
name: Minimal versions
7770
runs-on: ubuntu-latest
@@ -89,7 +82,7 @@ jobs:
8982
- name: Downgrade dependencies to minimal versions
9083
run: cargo +nightly generate-lockfile -Z minimal-versions
9184
- name: Compile with minimal versions
92-
run: cargo +stable check --workspace --all-features --locked
85+
run: cargo +stable check --workspace --all-features --locked --keep-going
9386
lockfile:
9487
runs-on: ubuntu-latest
9588
steps:
@@ -116,7 +109,7 @@ jobs:
116109
- name: Check documentation
117110
env:
118111
RUSTDOCFLAGS: -D warnings
119-
run: cargo doc --workspace --all-features --no-deps --document-private-items
112+
run: cargo doc --workspace --all-features --no-deps --document-private-items --keep-going
120113
rustfmt:
121114
name: rustfmt
122115
runs-on: ubuntu-latest
@@ -162,7 +155,7 @@ jobs:
162155
sarif_file: clippy-results.sarif
163156
wait-for-processing: true
164157
- name: Report status
165-
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
158+
run: cargo clippy --workspace --all-features --all-targets --keep-going -- -D warnings --allow deprecated
166159
coverage:
167160
name: Coverage
168161
runs-on: ubuntu-latest

.github/workflows/rust-next.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ jobs:
3636
with:
3737
toolchain: ${{ matrix.rust }}
3838
- uses: Swatinem/rust-cache@v2
39-
- name: Default features
40-
run: cargo test --workspace
41-
- name: All features
42-
run: cargo test --workspace --all-features
43-
- name: No-default features
44-
run: cargo test --workspace --no-default-features
39+
- uses: taiki-e/install-action@cargo-hack
40+
- name: Build
41+
run: cargo test --workspace --no-run
42+
- name: Test
43+
run: cargo hack test --each-feature --workspace
4544
latest:
4645
name: "Check latest dependencies"
4746
runs-on: ubuntu-latest
@@ -53,11 +52,10 @@ jobs:
5352
with:
5453
toolchain: stable
5554
- uses: Swatinem/rust-cache@v2
55+
- uses: taiki-e/install-action@cargo-hack
5656
- name: Update dependencies
5757
run: cargo update
58-
- name: Default features
59-
run: cargo test --workspace --all-targets
60-
- name: All features
61-
run: cargo test --workspace --all-targets --all-features
62-
- name: No-default features
63-
run: cargo test --workspace --all-targets --no-default-features
58+
- name: Build
59+
run: cargo test --workspace --no-run
60+
- name: Test
61+
run: cargo hack test --each-feature --workspace

.pre-commit-config.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1+
default_install_hook_types: ["pre-commit", "commit-msg"]
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4+
rev: v5.0.0
45
hooks:
56
- id: check-yaml
6-
stages: [commit]
77
- id: check-json
8-
stages: [commit]
98
- id: check-toml
10-
stages: [commit]
119
- id: check-merge-conflict
12-
stages: [commit]
1310
- id: check-case-conflict
14-
stages: [commit]
1511
- id: detect-private-key
16-
stages: [commit]
1712
- repo: https://github.com/crate-ci/typos
18-
rev: v1.16.20
13+
rev: v1.32.0
1914
hooks:
2015
- id: typos
21-
stages: [commit]
2216
- repo: https://github.com/crate-ci/committed
23-
rev: v1.0.20
17+
rev: v1.1.7
2418
hooks:
2519
- id: committed
26-
stages: [commit-msg]

Cargo.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ include = [
1313
"Cargo.toml",
1414
"LICENSE*",
1515
"README.md",
16-
"benches/**/*",
1716
"examples/**/*"
1817
]
1918

2019
[workspace.lints.rust]
2120
rust_2018_idioms = { level = "warn", priority = -1 }
21+
unnameable_types = "warn"
2222
unreachable_pub = "warn"
2323
unsafe_op_in_unsafe_fn = "warn"
2424
unused_lifetimes = "warn"
@@ -61,7 +61,7 @@ lossy_float_literal = "warn"
6161
macro_use_imports = "warn"
6262
mem_forget = "warn"
6363
mutex_integer = "warn"
64-
needless_continue = "warn"
64+
needless_continue = "allow"
6565
needless_for_each = "warn"
6666
negative_feature_names = "warn"
6767
path_buf_push_overwrite = "warn"
@@ -85,3 +85,12 @@ uninlined_format_args = "warn"
8585
verbose_file_reads = "warn"
8686
wildcard_imports = "warn"
8787
zero_sized_map_values = "warn"
88+
89+
[profile.dev]
90+
panic = "abort"
91+
92+
[profile.release]
93+
panic = "abort"
94+
codegen-units = 1
95+
lto = true
96+
# debug = "line-tables-only" # requires Cargo 1.71

crates/snapbox-macros/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
name = "snapbox-macros"
33
version = "0.3.10"
44
description = "Snapshot testing toolbox"
5-
homepage = "https://github.com/assert-rs/trycmd/tree/main/crates/snapbox"
6-
documentation = "http://docs.rs/snapbox/"
7-
readme = "README.md"
85
categories = ["development-tools::testing"]
96
keywords = ["cli", "test", "assert", "command"]
107
repository.workspace = true

crates/snapbox-macros/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
#![warn(clippy::print_stderr)]
33
#![warn(clippy::print_stdout)]
44

5-
#[doc = include_str!("../README.md")]
6-
#[cfg(doctest)]
7-
pub struct ReadmeDoctests;
8-
95
#[cfg(feature = "color")]
106
pub use anstream::eprint;
117
#[cfg(feature = "color")]
@@ -56,3 +52,7 @@ macro_rules! cargo_bin {
5652
::std::path::Path::new(env!(concat!("CARGO_BIN_EXE_", $bin_target_name)))
5753
};
5854
}
55+
56+
#[doc = include_str!("../README.md")]
57+
#[cfg(doctest)]
58+
pub struct ReadmeDoctests;

crates/snapbox/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
name = "snapbox"
33
version = "0.6.21"
44
description = "Snapshot testing toolbox"
5-
homepage = "https://github.com/assert-rs/trycmd/tree/main/crates/snapbox"
6-
documentation = "http://docs.rs/snapbox/"
7-
readme = "README.md"
85
categories = ["development-tools::testing"]
96
keywords = ["cli", "test", "assert", "command"]
107
repository.workspace = true

crates/snapbox/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@
6464
#![warn(clippy::print_stderr)]
6565
#![warn(clippy::print_stdout)]
6666

67-
#[doc = include_str!("../README.md")]
68-
#[cfg(doctest)]
69-
pub struct ReadmeDoctests;
70-
7167
mod macros;
7268

7369
pub mod assert;
@@ -143,3 +139,7 @@ pub fn assert_subset_matches(
143139
.action_env(assert::DEFAULT_ACTION_ENV)
144140
.subset_matches(pattern_root, actual_root);
145141
}
142+
143+
#[doc = include_str!("../README.md")]
144+
#[cfg(doctest)]
145+
pub struct ReadmeDoctests;

0 commit comments

Comments
 (0)