Skip to content

Commit 71ff566

Browse files
authored
Merge pull request #326 from epage/template
chore: Update from '_rust/main' template
2 parents 73bb418 + b020d97 commit 71ff566

File tree

7 files changed

+200
-71
lines changed

7 files changed

+200
-71
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
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:
@@ -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 }}
@@ -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
@@ -55,7 +55,7 @@ jobs:
5555
toolchain: stable
5656
- uses: Swatinem/rust-cache@v2
5757
- uses: taiki-e/install-action@cargo-hack
58-
- name: Update dependencues
58+
- name: Update dependencies
5959
run: cargo update
6060
- name: Build
6161
run: cargo test --workspace --no-run

CONTRIBUTING.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,42 @@ to re-work some of it and the discouragement that goes along with that.
2929

3030
### Process
3131

32-
When you first post a PR, we request that the the commit history get cleaned
33-
up. We recommend avoiding this during the PR to make it easier to review how
34-
feedback was handled. Once the commit is ready, we'll ask you to clean up the
35-
commit history. Once you let us know this is done, we can move forward with
36-
merging! If you are uncomfortable with these parts of git, let us know and we
37-
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)
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
5268

5369
## Releasing
5470

Cargo.toml

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

55
[workspace.package]
6+
repository = "https://github.com/rust-cli/env_logger"
67
license = "MIT OR Apache-2.0"
78
edition = "2021"
89
rust-version = "1.71" # MSRV
@@ -19,7 +20,7 @@ include = [
1920
]
2021

2122
[workspace.lints.rust]
22-
rust_2018_idioms = "warn"
23+
rust_2018_idioms = { level = "warn", priority = -1 }
2324
unreachable_pub = "warn"
2425
unsafe_op_in_unsafe_fn = "warn"
2526
unused_lifetimes = "warn"
@@ -60,7 +61,6 @@ let_and_return = "allow" # sometimes good to name what you are returning
6061
linkedlist = "warn"
6162
lossy_float_literal = "warn"
6263
macro_use_imports = "warn"
63-
match_wildcard_for_single_variants = "warn"
6464
mem_forget = "warn"
6565
mutex_integer = "warn"
6666
needless_continue = "warn"
@@ -75,7 +75,6 @@ rest_pat_in_fully_bound_structs = "warn"
7575
same_functions_in_if_condition = "warn"
7676
self_named_module_files = "warn"
7777
semicolon_if_nothing_returned = "warn"
78-
single_match_else = "warn"
7978
str_to_string = "warn"
8079
string_add = "warn"
8180
string_add_assign = "warn"
@@ -94,9 +93,9 @@ description = """
9493
A logging implementation for `log` which is configured via an environment
9594
variable.
9695
"""
97-
repository = "https://github.com/rust-cli/env_logger"
9896
categories = ["development-tools::debugging"]
9997
keywords = ["logging", "log", "logger"]
98+
repository.workspace = true
10099
license.workspace = true
101100
edition.workspace = true
102101
rust-version.workspace = true

crates/env_filter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ version = "0.1.2"
44
description = """
55
Filter log events using environment variables
66
"""
7-
repository = "https://github.com/rust-cli/env_logger"
87
categories = ["development-tools::debugging"]
98
keywords = ["logging", "log", "logger"]
9+
repository.workspace = true
1010
license.workspace = true
1111
edition.workspace = true
1212
rust-version.workspace = true

0 commit comments

Comments
 (0)