Skip to content

Commit b6c895e

Browse files
committed
chore: Update from _rust/main template
2 parents f2c1f08 + 51de731 commit b6c895e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+414
-203
lines changed

.clippy.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
msrv = "1.75" # MSRV
2-
warn-on-all-wildcard-imports = true
1+
allow-print-in-tests = true
32
allow-expect-in-tests = true
43
allow-unwrap-in-tests = true
54
allow-dbg-in-tests = true

.github/renovate.json5

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
'before 5am on the first day of the month',
44
],
55
semanticCommits: 'enabled',
6+
commitMessageLowerCase: 'never',
67
configMigration: true,
78
dependencyDashboard: true,
89
customManagers: [
@@ -17,29 +18,28 @@
1718
'^\\.github/workflows/rust-next.yml$',
1819
],
1920
matchStrings: [
20-
'MSRV.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
21-
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?MSRV',
21+
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
22+
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?STABLE',
2223
],
23-
depNameTemplate: 'rust',
24+
depNameTemplate: 'STABLE',
2425
packageNameTemplate: 'rust-lang/rust',
2526
datasourceTemplate: 'github-releases',
2627
},
2728
],
2829
packageRules: [
2930
{
30-
commitMessageTopic: 'MSRV',
31+
commitMessageTopic: 'Rust Stable',
3132
matchManagers: [
3233
'custom.regex',
3334
],
3435
matchPackageNames: [
35-
'rust',
36+
'STABLE',
3637
],
37-
minimumReleaseAge: '126 days', // 3 releases * 6 weeks per release * 7 days per week
38-
internalChecksFilter: 'strict',
3938
extractVersion: '^(?<version>\\d+\\.\\d+)', // Drop the patch version
4039
schedule: [
4140
'* * * * *',
4241
],
42+
automerge: true,
4343
},
4444
// Goals:
4545
// - Rollup safe upgrades to reduce CI runner load
@@ -62,6 +62,7 @@
6262
matchCurrentVersion: '>=1.0.0',
6363
matchUpdateTypes: [
6464
'minor',
65+
'patch',
6566
],
6667
automerge: true,
6768
groupName: 'compatible',

.github/settings.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ labels:
4141
color: '#c2e0c6'
4242
description: "Help wanted!"
4343

44-
branches:
45-
- name: master
46-
protection:
47-
required_pull_request_reviews: null
48-
required_conversation_resolution: true
49-
required_status_checks:
50-
# Required. Require branches to be up to date before merging.
51-
strict: false
52-
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
53-
enforce_admins: false
54-
restrictions: null
44+
# This serves more as documentation.
45+
# Branch protection API was replaced by rulesets but settings isn't updated.
46+
# See https://github.com/repository-settings/app/issues/825
47+
#
48+
# branches:
49+
# - name: master
50+
# protection:
51+
# required_pull_request_reviews: null
52+
# required_conversation_resolution: true
53+
# required_status_checks:
54+
# # Required. Require branches to be up to date before merging.
55+
# strict: false
56+
# contexts: ["CI", "Spell Check with Typos"]
57+
# enforce_admins: false
58+
# restrictions: null

.github/workflows/audit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ env:
1717
CARGO_TERM_COLOR: always
1818
CLICOLOR: 1
1919

20+
concurrency:
21+
group: "${{ github.workflow }}-${{ github.ref }}"
22+
cancel-in-progress: true
23+
2024
jobs:
2125
security_audit:
2226
permissions:

.github/workflows/ci.yml

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,27 @@ env:
1515
CLICOLOR: 1
1616
COLUMNS: 130
1717

18+
concurrency:
19+
group: "${{ github.workflow }}-${{ github.ref }}"
20+
cancel-in-progress: true
21+
1822
jobs:
1923
ci:
2024
permissions:
2125
contents: none
2226
name: CI
23-
needs: [test, msrv, docs, rustfmt, clippy]
27+
needs: [test, msrv, lockfile, docs, rustfmt, clippy]
2428
runs-on: ubuntu-latest
29+
if: "always()"
2530
steps:
26-
- name: Done
27-
run: exit 0
31+
- name: Failed
32+
run: exit 1
33+
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
2834
test:
2935
name: Test
3036
strategy:
3137
matrix:
32-
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
38+
os: ["ubuntu-latest", "windows-latest", "macos-14"]
3339
rust: ["stable"]
3440
continue-on-error: ${{ matrix.rust != 'stable' }}
3541
runs-on: ${{ matrix.os }}
@@ -42,31 +48,25 @@ jobs:
4248
toolchain: ${{ matrix.rust }}
4349
components: rustfmt
4450
- uses: Swatinem/rust-cache@v2
51+
- uses: taiki-e/install-action@cargo-hack
4552
- name: Build
46-
run: cargo test --no-run --workspace --all-features
47-
- name: Default features
48-
run: cargo test --workspace
49-
- name: All features
50-
run: cargo test --workspace --all-features
51-
- name: No-default features
52-
run: cargo test --workspace --no-default-features
53+
run: cargo test --workspace --no-run
54+
- name: Test
55+
run: cargo hack test --feature-powerset --workspace
5356
msrv:
54-
name: "Check MSRV: 1.75"
57+
name: "Check MSRV"
5558
runs-on: ubuntu-latest
5659
steps:
5760
- name: Checkout repository
5861
uses: actions/checkout@v4
5962
- name: Install Rust
6063
uses: dtolnay/rust-toolchain@stable
6164
with:
62-
toolchain: "1.75" # MSRV
65+
toolchain: stable
6366
- uses: Swatinem/rust-cache@v2
67+
- uses: taiki-e/install-action@cargo-hack
6468
- name: Default features
65-
run: cargo check --workspace --all-targets
66-
- name: All features
67-
run: cargo check --workspace --all-targets --all-features
68-
- name: No-default features
69-
run: cargo check --workspace --all-targets --no-default-features
69+
run: cargo hack check --feature-powerset --locked --rust-version --ignore-private --workspace --all-targets
7070
lockfile:
7171
runs-on: ubuntu-latest
7272
steps:
@@ -78,7 +78,7 @@ jobs:
7878
toolchain: stable
7979
- uses: Swatinem/rust-cache@v2
8080
- name: "Is lockfile updated?"
81-
run: cargo fetch --locked
81+
run: cargo update --workspace --locked
8282
docs:
8383
name: Docs
8484
runs-on: ubuntu-latest
@@ -88,7 +88,7 @@ jobs:
8888
- name: Install Rust
8989
uses: dtolnay/rust-toolchain@stable
9090
with:
91-
toolchain: stable
91+
toolchain: "1.76" # STABLE
9292
- uses: Swatinem/rust-cache@v2
9393
- name: Check documentation
9494
env:
@@ -103,9 +103,7 @@ jobs:
103103
- name: Install Rust
104104
uses: dtolnay/rust-toolchain@stable
105105
with:
106-
# Not MSRV because its harder to jump between versions and people are
107-
# more likely to have stable
108-
toolchain: stable
106+
toolchain: "1.76" # STABLE
109107
components: rustfmt
110108
- uses: Swatinem/rust-cache@v2
111109
- name: Check formatting
@@ -121,13 +119,13 @@ jobs:
121119
- name: Install Rust
122120
uses: dtolnay/rust-toolchain@stable
123121
with:
124-
toolchain: "1.75" # MSRV
122+
toolchain: "1.76" # STABLE
125123
components: clippy
126124
- uses: Swatinem/rust-cache@v2
127125
- name: Install SARIF tools
128-
run: cargo install clippy-sarif --version 0.3.4 --locked # Held back due to msrv
126+
run: cargo install clippy-sarif --locked
129127
- name: Install SARIF tools
130-
run: cargo install sarif-fmt --version 0.3.4 --locked # Held back due to msrv
128+
run: cargo install sarif-fmt --locked
131129
- name: Check
132130
run: >
133131
cargo clippy --workspace --all-features --all-targets --message-format=json -- -D warnings --allow deprecated
@@ -142,3 +140,22 @@ jobs:
142140
wait-for-processing: true
143141
- name: Report status
144142
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
143+
coverage:
144+
name: Coverage
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Checkout repository
148+
uses: actions/checkout@v4
149+
- name: Install Rust
150+
uses: dtolnay/rust-toolchain@stable
151+
with:
152+
toolchain: stable
153+
- uses: Swatinem/rust-cache@v2
154+
- name: Install cargo-tarpaulin
155+
run: cargo install cargo-tarpaulin
156+
- name: Gather coverage
157+
run: cargo tarpaulin --output-dir coverage --out lcov
158+
- name: Publish to Coveralls
159+
uses: coverallsapp/github-action@master
160+
with:
161+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/committed.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ env:
1111
CARGO_TERM_COLOR: always
1212
CLICOLOR: 1
1313

14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
1418
jobs:
1519
committed:
1620
name: Lint Commits

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ env:
1212
CARGO_TERM_COLOR: always
1313
CLICOLOR: 1
1414

15+
concurrency:
16+
group: "${{ github.workflow }}-${{ github.ref }}"
17+
cancel-in-progress: true
18+
1519
jobs:
1620
pre-commit:
1721
permissions:

.github/workflows/rust-next.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ env:
1313
CLICOLOR: 1
1414
COLUMNS: 130
1515

16+
concurrency:
17+
group: "${{ github.workflow }}-${{ github.ref }}"
18+
cancel-in-progress: true
19+
1620
jobs:
1721
test:
1822
name: Test
1923
strategy:
2024
matrix:
21-
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
25+
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-14"]
2226
rust: ["stable", "beta"]
2327
include:
2428
- os: ubuntu-latest
@@ -34,12 +38,11 @@ jobs:
3438
toolchain: ${{ matrix.rust }}
3539
components: rustfmt
3640
- uses: Swatinem/rust-cache@v2
37-
- name: Default features
38-
run: cargo test --workspace
39-
- name: All features
40-
run: cargo test --workspace --all-features
41-
- name: No-default features
42-
run: cargo test --workspace --no-default-features
41+
- uses: taiki-e/install-action@cargo-hack
42+
- name: Build
43+
run: cargo test --workspace --no-run
44+
- name: Test
45+
run: cargo hack test --feature-powerset --workspace
4346
latest:
4447
name: "Check latest dependencies"
4548
runs-on: ubuntu-latest
@@ -52,11 +55,10 @@ jobs:
5255
toolchain: stable
5356
components: rustfmt
5457
- uses: Swatinem/rust-cache@v2
58+
- uses: taiki-e/install-action@cargo-hack
5559
- name: Update dependencues
5660
run: cargo update
57-
- name: Default features
58-
run: cargo test --workspace
59-
- name: All features
60-
run: cargo test --workspace --all-features
61-
- name: No-default features
62-
run: cargo test --workspace --no-default-features
61+
- name: Build
62+
run: cargo test --workspace --no-run
63+
- name: Test
64+
run: cargo hack test --feature-powerset --workspace

Cargo.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,74 @@ include = [
2121
"examples/**/*"
2222
]
2323

24+
[workspace.lints.rust]
25+
rust_2018_idioms = "warn"
26+
unreachable_pub = "warn"
27+
unsafe_op_in_unsafe_fn = "warn"
28+
unused_lifetimes = "warn"
29+
unused_macro_rules = "warn"
30+
unused_qualifications = "warn"
31+
32+
[workspace.lints.clippy]
33+
bool_assert_comparison = "allow"
34+
branches_sharing_code = "allow"
35+
checked_conversions = "warn"
36+
collapsible_else_if = "allow"
37+
create_dir = "warn"
38+
dbg_macro = "warn"
39+
debug_assert_with_mut_call = "warn"
40+
doc_markdown = "warn"
41+
empty_enum = "warn"
42+
enum_glob_use = "warn"
43+
expl_impl_clone_on_copy = "warn"
44+
explicit_deref_methods = "warn"
45+
explicit_into_iter_loop = "warn"
46+
fallible_impl_from = "warn"
47+
filter_map_next = "warn"
48+
flat_map_option = "warn"
49+
float_cmp_const = "warn"
50+
fn_params_excessive_bools = "warn"
51+
from_iter_instead_of_collect = "warn"
52+
if_same_then_else = "allow"
53+
implicit_clone = "warn"
54+
imprecise_flops = "warn"
55+
inconsistent_struct_constructor = "warn"
56+
inefficient_to_string = "warn"
57+
infinite_loop = "warn"
58+
invalid_upcast_comparisons = "warn"
59+
large_digit_groups = "warn"
60+
large_stack_arrays = "warn"
61+
large_types_passed_by_value = "warn"
62+
let_and_return = "allow" # sometimes good to name what you are returning
63+
linkedlist = "warn"
64+
lossy_float_literal = "warn"
65+
macro_use_imports = "warn"
66+
match_wildcard_for_single_variants = "warn"
67+
mem_forget = "warn"
68+
mutex_integer = "warn"
69+
needless_for_each = "warn"
70+
negative_feature_names = "warn"
71+
path_buf_push_overwrite = "warn"
72+
ptr_as_ptr = "warn"
73+
rc_mutex = "warn"
74+
redundant_feature_names = "warn"
75+
ref_option_ref = "warn"
76+
rest_pat_in_fully_bound_structs = "warn"
77+
same_functions_in_if_condition = "warn"
78+
self_named_module_files = "warn"
79+
semicolon_if_nothing_returned = "warn"
80+
single_match_else = "warn"
81+
str_to_string = "warn"
82+
string_add = "warn"
83+
string_add_assign = "warn"
84+
string_lit_as_bytes = "warn"
85+
string_to_string = "warn"
86+
todo = "warn"
87+
trait_duplication_in_bounds = "warn"
88+
verbose_file_reads = "warn"
89+
wildcard_imports = "warn"
90+
zero_sized_map_values = "warn"
91+
2492
[profile.dev]
2593
panic = "abort"
2694

0 commit comments

Comments
 (0)