Skip to content

Commit b68b0b8

Browse files
authored
Merge pull request #48 from epage/template
chore: Update from _rust/main template
2 parents a566da0 + 3da4bda commit b68b0b8

File tree

5 files changed

+190
-63
lines changed

5 files changed

+190
-63
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
permissions:
2424
contents: none
2525
name: CI
26-
needs: [test, msrv, lockfile, docs, rustfmt, clippy]
26+
needs: [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions]
2727
runs-on: ubuntu-latest
2828
if: "always()"
2929
steps:
@@ -67,6 +67,24 @@ jobs:
6767
- uses: taiki-e/install-action@cargo-hack
6868
- name: Default features
6969
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
70+
minimal-versions:
71+
name: Minimal versions
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v4
76+
- name: Install stable Rust
77+
uses: dtolnay/rust-toolchain@stable
78+
with:
79+
toolchain: stable
80+
- name: Install nightly Rust
81+
uses: dtolnay/rust-toolchain@stable
82+
with:
83+
toolchain: nightly
84+
- name: Downgrade dependencies to minimal versions
85+
run: cargo +nightly generate-lockfile -Z minimal-versions
86+
- name: Compile with minimal versions
87+
run: cargo +stable check --workspace --all-features --locked
7088
lockfile:
7189
runs-on: ubuntu-latest
7290
steps:

.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
toolchain: stable
5454
- uses: Swatinem/rust-cache@v2
5555
- uses: taiki-e/install-action@cargo-hack
56-
- name: Update dependencues
56+
- name: Update dependencies
5757
run: cargo update
5858
- name: Build
5959
run: cargo test --workspace --no-run

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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
resolver = "2"
33

44
[workspace.package]
5+
repository = "https://github.com/rust-cli/roff-rs"
56
license = "MIT OR Apache-2.0"
67
edition = "2021"
78
rust-version = "1.70" # 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"
@@ -51,15 +52,13 @@ inconsistent_struct_constructor = "warn"
5152
inefficient_to_string = "warn"
5253
infinite_loop = "warn"
5354
invalid_upcast_comparisons = "warn"
54-
items_after_statements = "warn"
5555
large_digit_groups = "warn"
5656
large_stack_arrays = "warn"
5757
large_types_passed_by_value = "warn"
5858
let_and_return = "allow" # sometimes good to name what you are returning
5959
linkedlist = "warn"
6060
lossy_float_literal = "warn"
6161
macro_use_imports = "warn"
62-
match_wildcard_for_single_variants = "warn"
6362
mem_forget = "warn"
6463
mutex_integer = "warn"
6564
needless_continue = "warn"
@@ -74,7 +73,6 @@ rest_pat_in_fully_bound_structs = "warn"
7473
same_functions_in_if_condition = "warn"
7574
self_named_module_files = "warn"
7675
semicolon_if_nothing_returned = "warn"
77-
single_match_else = "warn"
7876
str_to_string = "warn"
7977
string_add = "warn"
8078
string_add_assign = "warn"
@@ -90,11 +88,11 @@ zero_sized_map_values = "warn"
9088
name = "roff"
9189
version = "0.2.2"
9290
description = "ROFF (man page format) generation library"
93-
repository = "https://github.com/rust-cli/roff-rs"
9491
homepage = "https://github.com/rust-cli/roff-rs"
9592
documentation = "https://docs.rs/roff"
9693
readme = "README.md"
9794
categories = ["development-tools::testing"]
95+
repository.workspace = true
9896
license.workspace = true
9997
edition.workspace = true
10098
rust-version.workspace = true

0 commit comments

Comments
 (0)