Skip to content

Commit e5887b2

Browse files
authored
Merge pull request #207 from epage/template
chore: Update from _rust/main template
2 parents 722a5a6 + 8b41ab1 commit e5887b2

File tree

9 files changed

+40
-29
lines changed

9 files changed

+40
-29
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Build
5151
run: cargo test --workspace --no-run
5252
- name: Test
53-
run: cargo hack test --feature-powerset --workspace
53+
run: cargo hack test --each-feature --workspace
5454
msrv:
5555
name: "Check MSRV"
5656
runs-on: ubuntu-latest
@@ -64,7 +64,7 @@ jobs:
6464
- uses: Swatinem/rust-cache@v2
6565
- uses: taiki-e/install-action@cargo-hack
6666
- name: Default features
67-
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --lib --bins
67+
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --lib --bins --keep-going
6868
minimal-versions:
6969
name: Minimal versions
7070
runs-on: ubuntu-latest
@@ -82,7 +82,7 @@ jobs:
8282
- name: Downgrade dependencies to minimal versions
8383
run: cargo +nightly generate-lockfile -Z minimal-versions
8484
- name: Compile with minimal versions
85-
run: cargo +stable check --workspace --all-features --locked
85+
run: cargo +stable check --workspace --all-features --locked --keep-going
8686
lockfile:
8787
runs-on: ubuntu-latest
8888
steps:
@@ -109,7 +109,7 @@ jobs:
109109
- name: Check documentation
110110
env:
111111
RUSTDOCFLAGS: -D warnings
112-
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
113113
rustfmt:
114114
name: rustfmt
115115
runs-on: ubuntu-latest
@@ -155,7 +155,7 @@ jobs:
155155
sarif_file: clippy-results.sarif
156156
wait-for-processing: true
157157
- name: Report status
158-
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
159159
coverage:
160160
name: Coverage
161161
runs-on: ubuntu-latest

.github/workflows/rust-next.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Build
4141
run: cargo test --workspace --no-run
4242
- name: Test
43-
run: cargo hack test --feature-powerset --workspace
43+
run: cargo hack test --each-feature --workspace
4444
latest:
4545
name: "Check latest dependencies"
4646
runs-on: ubuntu-latest
@@ -58,4 +58,4 @@ jobs:
5858
- name: Build
5959
run: cargo test --workspace --no-run
6060
- name: Test
61-
run: cargo hack test --feature-powerset --workspace
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.lock",
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"
@@ -86,6 +86,15 @@ verbose_file_reads = "warn"
8686
wildcard_imports = "warn"
8787
zero_sized_map_values = "warn"
8888

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
97+
8998
[package]
9099
name = "annotate-snippets"
91100
version = "0.11.5"

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ which may look like this:
1515
Local Development
1616
-----------------
1717

18-
cargo build
19-
cargo test
18+
```console
19+
$ cargo build
20+
$ cargo test
21+
```
2022

2123
When submitting a PR please use [`cargo fmt`][] (nightly).
2224

deny.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ allow = [
8787
"MIT",
8888
"MIT-0",
8989
"Apache-2.0",
90+
"BSD-2-Clause",
9091
"BSD-3-Clause",
9192
"MPL-2.0",
9293
"Unicode-DFS-2016",

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@ pub use level::Level;
5858
#[doc(inline)]
5959
pub use renderer::Renderer;
6060
pub use snippet::*;
61+
62+
#[doc = include_str!("../README.md")]
63+
#[cfg(doctest)]
64+
pub struct ReadmeDoctests;

0 commit comments

Comments
 (0)