Skip to content

Commit

Permalink
cargo update & lint/clippy/rustfmt/cargo-deny fixes. (#3)
Browse files Browse the repository at this point in the history
This fixes the remaining CI failures.

The `rustfmt.toml` change was prompted by @Firestar99's formatting
changes in #2, and the subsequent local rebasing, with `version = "Two"`
causing warnings due to:
- rust-lang/rustfmt#6247

So the perma-unstable `rustfmt.toml` `version` config is now
`style_edition = "2024"`, and hopefully that gets stabilized at the same
time as Rust 2024 becoming stable.
  • Loading branch information
eddyb authored Oct 4, 2024
2 parents 39140c7 + c465e02 commit 339e38e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 33 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ jobs:
submodules: true
- uses: actions-rs/toolchain@v1
with:
# HACK(eddyb) only nightly supports setting `version = "Two"`
# in `rustfmt.toml`, which is needed to format array/slice patterns
# at all (see https://github.com/rust-lang/rustfmt/pull/4994).
# FIXME(eddyb) `style_edition = "2024"` in `rustfmt.toml` is what keeps
# this on `nightly`, should switch to `stable` when that stabilizes.
toolchain: nightly
override: true
# HACK(eddyb) use `nightly` by default without breaking the ability to
# temporarily bypass it through `rust-toolchain.toml`.
default: true
override: false

# run cargo fetch w/ --locked to verify Cargo.lock is up-to-date
- run: cargo fetch --locked
Expand Down Expand Up @@ -91,7 +93,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: EmbarkStudios/cargo-deny-action@v2

publish-check:
name: Publish Check
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
smallvec = { version = "1.7.0", features = ["serde", "union"] }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(git_main_docs)'] }

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs", "--document-private-items"]
21 changes: 4 additions & 17 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@
# More documentation for the advisories section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
# The lint level for security vulnerabilities
vulnerability = "deny"
# The lint level for unmaintained crates
unmaintained = "deny"
# NOTE(eddyb) see https://github.com/EmbarkStudios/cargo-deny/pull/611.
version = 2
# The lint level for crates that have been yanked from their source registry
yanked = "deny"
# The lint level for crates with security notices. Note that as of
# 2019-12-17 there are no security notice advisories in
# https://github.com/rustsec/advisory-db
notice = "deny"

# This section is considered when running `cargo deny check licenses`
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses]
# The lint level for crates which do not have a detectable license
unlicensed = "deny"
# NOTE(eddyb) see https://github.com/EmbarkStudios/cargo-deny/pull/611.
version = 2
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
Expand All @@ -27,8 +21,6 @@ allow = [
"Apache-2.0",
"Unicode-DFS-2016",
]
# Lint level for licenses considered copyleft
copyleft = "deny"

# This section is considered when running `cargo deny check bans`.
# More documentation about the 'bans' section can be found here:
Expand All @@ -38,11 +30,6 @@ copyleft = "deny"
multiple-versions = "deny"
# Lint level for when a crate version requirement is `*`
wildcards = "deny"
# Certain crates/versions that will be skipped when doing duplicate detection.
skip = [
# FIXME(eddyb) `syn 2` has not replaced `syn 1` across the ecosystem yet.
{ name = "syn", version = "2" },
]

# This section is considered when running `cargo deny check sources`.
# More documentation about the 'sources' section can be found here:
Expand Down
4 changes: 1 addition & 3 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# HACK(eddyb) needed to format array/slice patterns at all, because it was a
# breaking change (see https://github.com/rust-lang/rustfmt/pull/4994).
version = "Two"
style_edition = "2024"

# HACK(eddyb) avoid random spilling of e.g. method call chains onto many lines.
use_small_heuristics = "Max"
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
clippy::match_wild_err_arm,
clippy::match_wildcard_for_single_variants,
clippy::mem_forget,
clippy::mismatched_target_os,
clippy::missing_enforced_import_renames,
clippy::mut_mut,
clippy::mutex_integer,
Expand Down Expand Up @@ -145,6 +144,9 @@
// NOTE(eddyb) ignored because it's misguided to suggest `let mut s = ...;`
// and `s.push_str(...);` when `+` is equivalent and does not require `let`.
clippy::string_add,
// FIXME(eddyb) rework doc comments to conform to linted expectations.
clippy::too_long_first_doc_paragraph,
)]
// NOTE(eddyb) this is stronger than the "Embark standard lints" above, because
// we almost never need `unsafe` code and this is a further "speed bump" to it.
Expand Down

0 comments on commit 339e38e

Please sign in to comment.