Skip to content

Commit bca960c

Browse files
authored
Merge pull request #97 from epage/template
chore: Update from '_rust/main' template
2 parents 39606f2 + 7875952 commit bca960c

File tree

6 files changed

+196
-60
lines changed

6 files changed

+196
-60
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 }}
@@ -69,6 +69,24 @@ jobs:
6969
- uses: taiki-e/install-action@cargo-hack
7070
- name: Default features
7171
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
72+
minimal-versions:
73+
name: Minimal versions
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Checkout repository
77+
uses: actions/checkout@v4
78+
- name: Install stable Rust
79+
uses: dtolnay/rust-toolchain@stable
80+
with:
81+
toolchain: stable
82+
- name: Install nightly Rust
83+
uses: dtolnay/rust-toolchain@stable
84+
with:
85+
toolchain: nightly
86+
- name: Downgrade dependencies to minimal versions
87+
run: cargo +nightly generate-lockfile -Z minimal-versions
88+
- name: Compile with minimal versions
89+
run: cargo +stable check --workspace --all-features --locked
7290
lockfile:
7391
runs-on: ubuntu-latest
7492
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
@@ -61,7 +61,7 @@ jobs:
6161
git config --global user.name "Test User"
6262
git config --global user.email "[email protected]"
6363
- uses: taiki-e/install-action@cargo-hack
64-
- name: Update dependencues
64+
- name: Update dependencies
6565
run: cargo update
6666
- name: Build
6767
run: cargo test --workspace --no-run

CONTRIBUTING.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,42 @@ to re-work some of it and the discouragement that goes along with that.
3737

3838
### Process
3939

40-
When you first post a PR, we request that the commit history get cleaned
41-
up. We recommend avoiding this during the PR to make it easier to review how
42-
feedback was handled. Once the commit is ready, we'll ask you to clean up the
43-
commit history. Once you let us know this is done, we can move forward with
44-
merging! If you are uncomfortable with these parts of git, let us know and we
45-
can help.
46-
47-
We ask that all new files have the copyright header. Please update the
48-
copyright year for files you are modifying.
49-
5040
As a heads up, we'll be running your PR through the following gauntlet:
5141
- warnings turned to compile errors
5242
- `cargo test`
5343
- `rustfmt`
5444
- `clippy`
5545
- `rustdoc`
46+
- [`committed`](https://github.com/crate-ci/committed) as we use [Conventional](https://www.conventionalcommits.org) commit style
47+
- [`typos`](https://github.com/crate-ci/typos) to check spelling
48+
49+
Not everything can be checked automatically though.
50+
51+
We request that the commit history gets cleaned up.
52+
We ask that commits are atomic, meaning they are complete and have a single responsibility.
53+
PRs should tell a cohesive story, with test and refactor commits that keep the
54+
fix or feature commits simple and clear.
55+
56+
Specifically, we would encouage
57+
- File renames be isolated into their own commit
58+
- Add tests in a commit before their feature or fix, showing the current behavior.
59+
The diff for the feature/fix commit will then show how the behavior changed,
60+
making it clearer to reviewrs and the community and showing people that the
61+
test is verifying the expected state.
62+
- e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520)
63+
64+
Note that we are talking about ideals.
65+
We understand having a clean history requires more advanced git skills;
66+
feel free to ask us for help!
67+
We might even suggest where it would work to be lax.
68+
We also understand that editing some early commits may cause a lot of churn
69+
with merge conflicts which can make it not worth editing all of the history.
70+
71+
For code organization, we recommend
72+
- Grouping `impl` blocks next to their type (or trait)
73+
- Grouping private items after the `pub` item that uses them.
74+
- 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.
75+
- The exact order is fuzzy; do what makes sense
5676

5777
## Releasing
5878

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 6 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/gitext-rs/git-fixture.git"
56
license = "MIT OR Apache-2.0"
67
edition = "2021"
78
rust-version = "1.74" # 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,10 +88,10 @@ zero_sized_map_values = "warn"
9088
name = "git-fixture"
9189
description = "Reproducible git trees for bug reporting and testing"
9290
version = "0.3.4"
93-
repository = "https://github.com/gitext-rs/git-fixture.git"
9491
documentation = "https://docs.rs/git-fixture"
9592
categories = ["command-line-interface", "development-tools"]
9693
keywords = ["git", "cli"]
94+
repository.workspace = true
9795
license.workspace = true
9896
edition.workspace = true
9997
rust-version.workspace = true
@@ -127,7 +125,7 @@ required-features = ["cli", "yaml", "json", "toml", "schema"]
127125
[dependencies]
128126
serde = { version = "1.0.150", features = ["derive"], optional = true }
129127
serde_yaml = { version = "0.8.17", optional = true }
130-
serde_json = { version = "1.0", optional = true }
128+
serde_json = { version = "1.0.85", optional = true }
131129
toml = { version = "0.8", optional = true }
132130
humantime = { version = "2", optional = true }
133131
humantime-serde = { version = "1", optional = true }
@@ -146,6 +144,9 @@ env_logger = "0.11.3"
146144
snapbox = "0.6.5"
147145
automod = "1.0.14"
148146

147+
[target.'cfg(any())'.dependencies]
148+
pkg-config = "0.3.26" # HACK: bad minimal dep in libgit2-sys
149+
149150
[profile.dev]
150151
panic = "abort"
151152

0 commit comments

Comments
 (0)