Skip to content

Commit 5303dd5

Browse files
authored
Merge pull request #356 from epage/template
chore: Update from _rust/main template
2 parents f7204aa + 455bb09 commit 5303dd5

File tree

9 files changed

+175
-66
lines changed

9 files changed

+175
-66
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
name: Test
3535
strategy:
3636
matrix:
37-
os: ["ubuntu-latest", "windows-latest", "macos-14"]
37+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
3838
rust: ["stable"]
3939
continue-on-error: ${{ matrix.rust != 'stable' }}
4040
runs-on: ${{ matrix.os }}
@@ -72,9 +72,6 @@ jobs:
7272
run: cargo hack check --all-features --locked --rust-version --ignore-private --workspace --all-targets
7373
- name: No-default features
7474
run: cargo hack check --no-default-features --locked --rust-version --ignore-private --workspace --all-targets
75-
# Make sure the library builds with all dependencies downgraded to their
76-
# oldest versions allowed by the semver spec. This ensures we have not
77-
# under-specified any dependency
7875
minimal-versions:
7976
name: Minimal versions
8077
runs-on: ubuntu-latest

.github/workflows/rust-next.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: Test
2222
strategy:
2323
matrix:
24-
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-14"]
24+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
2525
rust: ["stable", "beta"]
2626
include:
2727
- os: ubuntu-latest
@@ -53,7 +53,7 @@ jobs:
5353
with:
5454
toolchain: stable
5555
- uses: Swatinem/rust-cache@v2
56-
- name: Update dependencues
56+
- name: Update dependencies
5757
run: cargo update
5858
- name: Default features
5959
run: cargo test --workspace --all-targets

CONTRIBUTING.md

Lines changed: 30 additions & 15 deletions
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6+
repository = "https://github.com/assert-rs/snapbox/"
67
license = "MIT OR Apache-2.0"
78
edition = "2021"
89
rust-version = "1.65" # MSRV
@@ -17,7 +18,7 @@ include = [
1718
]
1819

1920
[workspace.lints.rust]
20-
rust_2018_idioms = "warn"
21+
rust_2018_idioms = { level = "warn", priority = -1 }
2122
unreachable_pub = "warn"
2223
unsafe_op_in_unsafe_fn = "warn"
2324
unused_lifetimes = "warn"

crates/snapbox-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
name = "snapbox-macros"
33
version = "0.3.10"
44
description = "Snapshot testing toolbox"
5-
repository = "https://github.com/assert-rs/trycmd/"
65
homepage = "https://github.com/assert-rs/trycmd/tree/main/crates/snapbox"
76
documentation = "http://docs.rs/snapbox/"
87
readme = "README.md"
98
categories = ["development-tools::testing"]
109
keywords = ["cli", "test", "assert", "command"]
10+
repository.workspace = true
1111
license.workspace = true
1212
edition.workspace = true
1313
rust-version.workspace = true

crates/snapbox/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
name = "snapbox"
33
version = "0.6.16"
44
description = "Snapshot testing toolbox"
5-
repository = "https://github.com/assert-rs/trycmd/"
65
homepage = "https://github.com/assert-rs/trycmd/tree/main/crates/snapbox"
76
documentation = "http://docs.rs/snapbox/"
87
readme = "README.md"
98
categories = ["development-tools::testing"]
109
keywords = ["cli", "test", "assert", "command"]
10+
repository.workspace = true
1111
license.workspace = true
1212
edition.workspace = true
1313
rust-version.workspace = true

crates/trycmd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name = "trycmd"
33
version = "0.15.6"
44
description = "Snapshot testing for a herd of CLI tests"
55
authors = ["Ed Page <[email protected]>"]
6-
repository = "https://github.com/assert-rs/trycmd.git"
76
homepage = "https://github.com/assert-rs/trycmd"
87
documentation = "http://docs.rs/trycmd/"
98
readme = "README.md"
109
categories = ["development-tools::testing"]
1110
keywords = ["cli", "test", "assert", "command", "duct"]
11+
repository.workspace = true
1212
license.workspace = true
1313
edition.workspace = true
1414
rust-version.workspace = true

crates/tryfn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name = "tryfn"
33
version = "0.2.3"
44
description = "File-driven snapshot testing for a function"
55
authors = ["Ed Page <[email protected]>"]
6-
repository = "https://github.com/assert-rs/trycmd.git"
76
homepage = "https://github.com/assert-rs/trycmd"
87
documentation = "http://docs.rs/tryfn/"
98
readme = "README.md"
109
categories = ["development-tools::testing"]
1110
keywords = ["test", "assert", "snapsjot"]
11+
repository.workspace = true
1212
license.workspace = true
1313
edition.workspace = true
1414
rust-version.workspace = true

0 commit comments

Comments
 (0)