Skip to content

Commit 063ac6d

Browse files
committed
chore: Update from _rust/main template
2 parents c7af471 + 266ead1 commit 063ac6d

File tree

13 files changed

+198
-68
lines changed

13 files changed

+198
-68
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
permissions:
2525
contents: none
2626
name: CI
27-
needs: [test, msrv, lockfile, docs, rustfmt, clippy]
27+
needs: [test, msrv, lockfile, docs, rustfmt, clippy, minimal-versions]
2828
runs-on: ubuntu-latest
2929
if: "always()"
3030
steps:
@@ -35,7 +35,7 @@ jobs:
3535
name: Test
3636
strategy:
3737
matrix:
38-
os: ["ubuntu-latest", "windows-latest", "macos-14"]
38+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
3939
rust: ["stable"]
4040
continue-on-error: ${{ matrix.rust != 'stable' }}
4141
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
name: Test
2323
strategy:
2424
matrix:
25-
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-14"]
25+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
2626
rust: ["stable", "beta"]
2727
include:
2828
- os: ubuntu-latest

CONTRIBUTING.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,42 @@ Auto-cleans up your change according to some rules we have like:
6262

6363
### Process
6464

65-
When you first post a PR, we request that the commit history get cleaned
66-
up. We recommend avoiding this during the PR to make it easier to review how
67-
feedback was handled. Once the commit is ready, we'll ask you to clean up the
68-
commit history. Once you let us know this is done, we can move forward with
69-
merging! If you are uncomfortable with these parts of git, let us know and we
70-
can help.
71-
72-
We ask that all new files have the copyright header. Please update the
73-
copyright year for files you are modifying.
74-
7565
As a heads up, we'll be running your PR through the following gauntlet:
7666
- warnings turned to compile errors
7767
- `cargo test`
7868
- `rustfmt`
7969
- `clippy`
8070
- `rustdoc`
81-
- [`committed`](https://github.com/crate-ci/committed) to enforce [conventional commits](https://www.conventionalcommits.org)
82-
83-
Check out our [CI][CI] for more information.
71+
- [`committed`](https://github.com/crate-ci/committed) as we use [Conventional](https://www.conventionalcommits.org) commit style
72+
- [`typos`](https://github.com/crate-ci/typos) to check spelling
73+
74+
Not everything can be checked automatically though.
75+
76+
We request that the commit history gets cleaned up.
77+
We ask that commits are atomic, meaning they are complete and have a single responsibility.
78+
PRs should tell a cohesive story, with test and refactor commits that keep the
79+
fix or feature commits simple and clear.
80+
81+
Specifically, we would encouage
82+
- File renames be isolated into their own commit
83+
- Add tests in a commit before their feature or fix, showing the current behavior.
84+
The diff for the feature/fix commit will then show how the behavior changed,
85+
making it clearer to reviewrs and the community and showing people that the
86+
test is verifying the expected state.
87+
- e.g. [clap#5520](https://github.com/clap-rs/clap/pull/5520)
88+
89+
Note that we are talking about ideals.
90+
We understand having a clean history requires more advanced git skills;
91+
feel free to ask us for help!
92+
We might even suggest where it would work to be lax.
93+
We also understand that editing some early commits may cause a lot of churn
94+
with merge conflicts which can make it not worth editing all of the history.
95+
96+
For code organization, we recommend
97+
- Grouping `impl` blocks next to their type (or trait)
98+
- Grouping private items after the `pub` item that uses them.
99+
- 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.
100+
- The exact order is fuzzy; do what makes sense
84101

85102
## Releasing
86103

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ default-members = ["crates/typos-cli"]
66
resolver = "2"
77

88
[workspace.package]
9-
license = "MIT OR Apache-2.0"
109
repository = "https://github.com/crate-ci/typos"
10+
license = "MIT OR Apache-2.0"
1111
edition = "2021"
1212
rust-version = "1.75" # MSRV
1313
include = [
@@ -22,7 +22,7 @@ include = [
2222
]
2323

2424
[workspace.lints.rust]
25-
rust_2018_idioms = "warn"
25+
rust_2018_idioms = { level = "warn", priority = -1 }
2626
unreachable_pub = "warn"
2727
unsafe_op_in_unsafe_fn = "warn"
2828
unused_lifetimes = "warn"
@@ -63,7 +63,6 @@ let_and_return = "allow" # sometimes good to name what you are returning
6363
linkedlist = "warn"
6464
lossy_float_literal = "warn"
6565
macro_use_imports = "warn"
66-
match_wildcard_for_single_variants = "warn"
6766
mem_forget = "warn"
6867
mutex_integer = "warn"
6968
needless_for_each = "warn"
@@ -77,14 +76,14 @@ rest_pat_in_fully_bound_structs = "warn"
7776
same_functions_in_if_condition = "warn"
7877
self_named_module_files = "warn"
7978
semicolon_if_nothing_returned = "warn"
80-
single_match_else = "warn"
8179
str_to_string = "warn"
8280
string_add = "warn"
8381
string_add_assign = "warn"
8482
string_lit_as_bytes = "warn"
8583
string_to_string = "warn"
8684
todo = "warn"
8785
trait_duplication_in_bounds = "warn"
86+
uninlined_format_args = "warn"
8887
verbose_file_reads = "warn"
8988
wildcard_imports = "warn"
9089
zero_sized_map_values = "warn"

crates/dictgen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.2.8"
44
description = "Compile-time case-insensitive map"
55
categories = ["development-tools", "text-processing"]
66
keywords = ["development", "spelling", "no_std"]
7-
license.workspace = true
87
repository.workspace = true
8+
license.workspace = true
99
edition.workspace = true
1010
rust-version.workspace = true
1111
include.workspace = true

crates/misspell-dict/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Source Code Spelling Correction"
55
readme = "README.md"
66
categories = ["development-tools", "text-processing"]
77
keywords = ["development", "spelling"]
8-
license.workspace = true
98
repository.workspace = true
9+
license.workspace = true
1010
edition.workspace = true
1111
rust-version.workspace = true
1212
include.workspace = true

crates/typos-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Source Code Spelling Correction"
55
readme = "../../README.md"
66
categories = ["development-tools", "text-processing"]
77
keywords = ["development", "spelling"]
8-
license.workspace = true
98
repository.workspace = true
9+
license.workspace = true
1010
edition.workspace = true
1111
rust-version.workspace = true
1212
include.workspace = true

crates/typos-dict/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Source Code Spelling Correction"
55
readme = "../../README.md"
66
categories = ["development-tools", "text-processing"]
77
keywords = ["development", "spelling"]
8-
license.workspace = true
98
repository.workspace = true
9+
license.workspace = true
1010
edition.workspace = true
1111
rust-version.workspace = true
1212
include.workspace = true

crates/typos-vars/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Source Code Spelling Correction"
55
readme = "../../README.md"
66
categories = ["development-tools", "text-processing"]
77
keywords = ["development", "spelling"]
8-
license.workspace = true
98
repository.workspace = true
9+
license.workspace = true
1010
edition.workspace = true
1111
rust-version.workspace = true
1212
include.workspace = true

crates/typos/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Source Code Spelling Correction"
55
readme = "../../README.md"
66
categories = ["development-tools", "text-processing"]
77
keywords = ["development", "spelling"]
8-
license.workspace = true
98
repository.workspace = true
9+
license.workspace = true
1010
edition.workspace = true
1111
rust-version.workspace = true
1212
include.workspace = true

crates/varcon-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "4.0.9"
44
description = "Varcon-relevant data structures"
55
readme = "../../README.md"
66
categories = ["text-processing"]
7-
license.workspace = true
87
repository.workspace = true
8+
license.workspace = true
99
edition.workspace = true
1010
rust-version.workspace = true
1111
include.workspace = true

crates/varcon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description = "Source Code Spelling Correction"
55
readme = "../../README.md"
66
categories = ["development-tools", "text-processing"]
77
keywords = ["development", "spelling"]
8-
license.workspace = true
98
repository.workspace = true
9+
license.workspace = true
1010
edition.workspace = true
1111
rust-version.workspace = true
1212
include.workspace = true

0 commit comments

Comments
 (0)