Skip to content

Commit ad69a8d

Browse files
authored
Merge pull request #149 from epage/template
chore: Update from '_rust/main' template
2 parents 61026e6 + fb40682 commit ad69a8d

File tree

6 files changed

+193
-64
lines changed

6 files changed

+193
-64
lines changed

.github/workflows/ci.yml

+20-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
permissions:
2323
contents: none
2424
name: CI
25-
needs: [test, msrv, lockfile, docs, rustfmt, clippy]
25+
needs: [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions]
2626
runs-on: ubuntu-latest
2727
if: "always()"
2828
steps:
@@ -33,7 +33,7 @@ jobs:
3333
name: Test
3434
strategy:
3535
matrix:
36-
os: ["ubuntu-latest", "windows-latest", "macos-14"]
36+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
3737
rust: ["stable"]
3838
continue-on-error: ${{ matrix.rust != 'stable' }}
3939
runs-on: ${{ matrix.os }}
@@ -64,6 +64,24 @@ jobs:
6464
- uses: taiki-e/install-action@cargo-hack
6565
- name: Default features
6666
run: cargo hack check --feature-powerset --exclude-features nightly --locked --rust-version --ignore-private --workspace --all-targets
67+
minimal-versions:
68+
name: Minimal versions
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v4
73+
- name: Install stable Rust
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
toolchain: stable
77+
- name: Install nightly Rust
78+
uses: dtolnay/rust-toolchain@stable
79+
with:
80+
toolchain: nightly
81+
- name: Downgrade dependencies to minimal versions
82+
run: cargo +nightly generate-lockfile -Z minimal-versions
83+
- name: Compile with minimal versions
84+
run: cargo +stable check --workspace --locked
6785
lockfile:
6886
runs-on: ubuntu-latest
6987
steps:

.github/workflows/rust-next.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: Test
2121
strategy:
2222
matrix:
23-
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-14"]
23+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
2424
rust: ["stable", "beta"]
2525
include:
2626
- os: ubuntu-latest
@@ -52,7 +52,7 @@ jobs:
5252
toolchain: stable
5353
- uses: Swatinem/rust-cache@v2
5454
- uses: taiki-e/install-action@cargo-hack
55-
- name: Update dependencues
55+
- name: Update dependencies
5656
run: cargo update
5757
- name: Build
5858
run: cargo test --workspace --no-run

CONTRIBUTING.md

+30-15
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,42 @@ to re-work some of it and the discouragement that goes along with that.
2929

3030
### Process
3131

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-
4532
As a heads up, we'll be running your PR through the following gauntlet:
4633
- warnings turned to compile errors
4734
- `cargo test`
4835
- `rustfmt`
4936
- `clippy`
5037
- `rustdoc`
51-
- [`committed`](https://github.com/crate-ci/committed)
52-
- [`typos`](https://github.com/crate-ci/typos)
38+
- [`committed`](https://github.com/crate-ci/committed) as we use [Conventional](https://www.conventionalcommits.org) commit style
39+
- [`typos`](https://github.com/crate-ci/typos) to check spelling
40+
41+
Not everything can be checked automatically though.
42+
43+
We request that the commit history gets cleaned up.
44+
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+
fix or feature commits simple and clear.
47+
48+
Specifically, we would encouage
49+
- File renames be isolated into their own commit
50+
- Add tests in a commit before their feature or fix, showing the current behavior.
51+
The diff for the feature/fix commit will then show how the behavior changed,
52+
making it clearer to reviewrs and the community and showing people that the
53+
test is verifying the expected state.
54+
- e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520)
55+
56+
Note that we are talking about ideals.
57+
We understand having a clean history requires more advanced git skills;
58+
feel free to ask us for help!
59+
We might even suggest where it would work to be lax.
60+
We also understand that editing some early commits may cause a lot of churn
61+
with merge conflicts which can make it not worth editing all of the history.
62+
63+
For code organization, we recommend
64+
- Grouping `impl` blocks next to their type (or trait)
65+
- Grouping private items after the `pub` item that uses them.
66+
- The intent is to help people quickly find the "relevant" details, allowing them to "dig deeper" as needed. Or put another way, the `pub` items serve as a table-of-contents.
67+
- The exact order is fuzzy; do what makes sense
5368

5469
## Releasing
5570

Cargo.toml

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ members = [
66
resolver = "2"
77

88
[workspace.package]
9+
repository = "https://github.com/rust-cli/human-panic"
910
license = "MIT OR Apache-2.0"
1011
edition = "2021"
1112
rust-version = "1.74" # MSRV
@@ -21,7 +22,7 @@ include = [
2122
]
2223

2324
[workspace.lints.rust]
24-
rust_2018_idioms = "warn"
25+
rust_2018_idioms = { level = "warn", priority = -1 }
2526
unreachable_pub = "warn"
2627
unsafe_op_in_unsafe_fn = "warn"
2728
unused_lifetimes = "warn"
@@ -62,7 +63,6 @@ let_and_return = "allow" # sometimes good to name what you are returning
6263
linkedlist = "warn"
6364
lossy_float_literal = "warn"
6465
macro_use_imports = "warn"
65-
match_wildcard_for_single_variants = "warn"
6666
mem_forget = "warn"
6767
mutex_integer = "warn"
6868
needless_continue = "warn"
@@ -77,7 +77,6 @@ rest_pat_in_fully_bound_structs = "warn"
7777
same_functions_in_if_condition = "warn"
7878
self_named_module_files = "warn"
7979
semicolon_if_nothing_returned = "warn"
80-
single_match_else = "warn"
8180
str_to_string = "warn"
8281
string_add = "warn"
8382
string_add_assign = "warn"
@@ -93,10 +92,10 @@ zero_sized_map_values = "warn"
9392
name = "human-panic"
9493
version = "2.0.1"
9594
description = "Panic messages for humans"
96-
repository = "https://github.com/rust-cli/human-panic"
9795
homepage = "https://github.com/rust-cli/human-panic"
9896
categories = ["command-line-interface"]
9997
keywords = ["cli", "panic"]
98+
repository.workspace = true
10099
license.workspace = true
101100
edition.workspace = true
102101
rust-version.workspace = true
@@ -128,7 +127,7 @@ serde_derive = "1.0.152"
128127
toml = { version = "0.8.8", default-features = false, features = ["display"] }
129128
serde = "1.0.152"
130129
os_info = "3.6.0"
131-
backtrace = "0.3.67"
130+
backtrace = "0.3.69"
132131

133132
[lints]
134133
workspace = true

0 commit comments

Comments
 (0)