Skip to content

Commit 182053a

Browse files
authored
Merge pull request #254 from epage/template
chore: Update from _rust/main template
2 parents a731b50 + faa1c36 commit 182053a

Some content is hidden

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

73 files changed

+238
-151
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
@@ -51,7 +51,7 @@ jobs:
5151
- name: Build
5252
run: cargo test --workspace --no-run
5353
- name: Test
54-
run: cargo hack test --feature-powerset --workspace
54+
run: cargo hack test --each-feature --workspace
5555
msrv:
5656
name: "Check MSRV"
5757
strategy:
@@ -68,7 +68,7 @@ jobs:
6868
- uses: Swatinem/rust-cache@v2
6969
- uses: taiki-e/install-action@cargo-hack
7070
- name: Default features
71-
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace
71+
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --keep-going
7272
minimal-versions:
7373
name: Minimal versions
7474
runs-on: ubuntu-latest
@@ -86,7 +86,7 @@ jobs:
8686
- name: Downgrade dependencies to minimal versions
8787
run: cargo +nightly generate-lockfile -Z minimal-versions
8888
- name: Compile with minimal versions
89-
run: cargo +stable check --workspace --all-features --locked
89+
run: cargo +stable check --workspace --all-features --locked --keep-going
9090
lockfile:
9191
runs-on: ubuntu-latest
9292
steps:
@@ -113,7 +113,7 @@ jobs:
113113
- name: Check documentation
114114
env:
115115
RUSTDOCFLAGS: -D warnings
116-
run: cargo doc --workspace --all-features --no-deps --document-private-items
116+
run: cargo doc --workspace --all-features --no-deps --document-private-items --keep-going
117117
rustfmt:
118118
name: rustfmt
119119
runs-on: ubuntu-latest
@@ -159,7 +159,7 @@ jobs:
159159
sarif_file: clippy-results.sarif
160160
wait-for-processing: true
161161
- name: Report status
162-
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
162+
run: cargo clippy --workspace --all-features --all-targets --keep-going -- -D warnings --allow deprecated
163163
coverage:
164164
name: Coverage
165165
runs-on: ubuntu-latest

.github/workflows/rust-next.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Build
4242
run: cargo test --workspace --no-run
4343
- name: Test
44-
run: cargo hack test --feature-powerset --workspace
44+
run: cargo hack test --each-feature --workspace
4545
latest:
4646
name: "Check latest dependencies"
4747
runs-on: ubuntu-latest
@@ -60,4 +60,4 @@ jobs:
6060
- name: Build
6161
run: cargo test --workspace --no-run
6262
- name: Test
63-
run: cargo hack test --feature-powerset --workspace
63+
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]

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ appreciate any level you're willing to do.
77

88
Need some new functionality to help? You can let us know by opening an
99
[issue][new issue]. It's helpful to look through [all issues][all issues] in
10-
case its already being talked about.
10+
case it's already being talked about.
1111

1212
## Bug Reports
1313

1414
Please let us know about what problems you run into, whether in behavior or
1515
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
16+
helpful to look through [all issues][all issues] in case it's already being
1717
talked about.
1818

1919
## Pull Requests
2020

21-
Looking for an idea? Check our [issues][issues]. If it's look more open ended,
21+
Looking for an idea? Check our [issues][issues]. If the issue looks open ended,
2222
it is probably best to post on the issue how you are thinking of resolving the
2323
issue so you can get feedback early in the process. We want you to be
2424
successful and it can be discouraging to find out a lot of re-work is needed.
@@ -41,15 +41,18 @@ As a heads up, we'll be running your PR through the following gauntlet:
4141
Not everything can be checked automatically though.
4242

4343
We request that the commit history gets cleaned up.
44+
4445
We ask that commits are atomic, meaning they are complete and have a single responsibility.
45-
PRs should tell a cohesive story, with test and refactor commits that keep the
46+
A complete commit should build, pass tests, update documentation and tests, and not have dead code.
47+
48+
PRs should tell a cohesive story, with refactor and test commits that keep the
4649
fix or feature commits simple and clear.
4750

4851
Specifically, we would encourage
4952
- File renames be isolated into their own commit
50-
- Add tests in a commit before their feature or fix, showing the current behavior.
53+
- Add tests in a commit before their feature or fix, showing the current behavior (i.e. they should pass).
5154
The diff for the feature/fix commit will then show how the behavior changed,
52-
making it clearer to reviewers and the community and showing people that the
55+
making the commit's intent clearer to reviewers and the community, and showing people that the
5356
test is verifying the expected state.
5457
- e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520)
5558

Cargo.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ include = [
1414
"Cargo.lock",
1515
"LICENSE*",
1616
"README.md",
17-
"benches/**/*",
1817
"examples/**/*"
1918
]
2019

2120
[workspace.lints.rust]
2221
rust_2018_idioms = { level = "warn", priority = -1 }
22+
unnameable_types = "warn"
2323
unreachable_pub = "warn"
2424
unsafe_op_in_unsafe_fn = "warn"
2525
unused_lifetimes = "warn"
@@ -62,7 +62,7 @@ lossy_float_literal = "warn"
6262
macro_use_imports = "warn"
6363
mem_forget = "warn"
6464
mutex_integer = "warn"
65-
needless_continue = "warn"
65+
needless_continue = "allow"
6666
needless_for_each = "warn"
6767
negative_feature_names = "warn"
6868
path_buf_push_overwrite = "warn"
@@ -86,3 +86,12 @@ uninlined_format_args = "warn"
8686
verbose_file_reads = "warn"
8787
wildcard_imports = "warn"
8888
zero_sized_map_values = "warn"
89+
90+
[profile.dev]
91+
panic = "abort"
92+
93+
[profile.release]
94+
panic = "abort"
95+
codegen-units = 1
96+
lto = true
97+
# debug = "line-tables-only" # requires Cargo 1.71

crates/anstream/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name = "anstream"
33
version = "0.6.18"
44
description = "A simple cross platform library for writing colored text to a terminal."
5-
homepage = "https://github.com/rust-cli/anstyle"
65
categories = ["command-line-interface"]
76
keywords = ["ansi", "terminal", "color", "strip", "wincon"]
87
repository.workspace = true

crates/anstream/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ overhead stripping of ANSI escape codes.
1818

1919
Licensed under either of
2020

21-
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
22-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
21+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
22+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
2323

2424
at your option.
2525

26-
### Contribution
26+
## [Contribute](../../CONTRIBUTING.md)
2727

2828
Unless you explicitly state otherwise, any contribution intentionally
2929
submitted for inclusion in the work by you, as defined in the Apache-2.0
30-
license, shall be dual licensed as above, without any additional terms or
30+
license, shall be dual-licensed as above, without any additional terms or
3131
conditions.
3232

3333
[Crates.io]: https://crates.io/crates/anstream

crates/anstream/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ pub fn stderr() -> Stderr {
8484

8585
/// Selection for overriding color output
8686
pub use colorchoice::ColorChoice;
87+
88+
#[doc = include_str!("../README.md")]
89+
#[cfg(doctest)]
90+
pub struct ReadmeDoctests;

0 commit comments

Comments
 (0)