Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use a standardized workspace lint table #134

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:

name: Docs

env:
RUSTDOCFLAGS: -D warnings

jobs:
docs:
name: Docs
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/github-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
uses: actions/dependency-review-action@v4
with:
# AND combinations are currently bugged and must be listed separately: https://github.com/actions/dependency-review-action/issues/263
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, Unicode-DFS-2016, (MIT OR Apache-2.0) AND Unicode-DFS-2016
# OR combinations are currently bugged and must be listed separately: https://github.com/actions/dependency-review-action/issues/670
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, Unicode-DFS-2016, (MIT OR Apache-2.0) AND Unicode-DFS-2016, Unlicense OR MIT
# anstyle is licensed as (MIT OR Apache-2.0), but the Github api fails to detect it: https://github.com/rust-cli/anstyle/tree/main/crates/anstyle
allow-dependencies-licenses: 'pkg:cargo/[email protected]'
comment-summary-in-pr: on-failure
Expand Down
147 changes: 44 additions & 103 deletions Cargo.lock

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

32 changes: 32 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,35 @@ wdk-sys = { path = "crates/wdk-sys", version = "0.2.0" }
bindgen = "0.69.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Until https://github.com/rust-lang/cargo/issues/12208 is resolved, each package in the workspace needs to explictly
# add the following block to its Cargo manifest in order to enable these global lint configurations:
#
# [lints]
# workspace = true

[workspace.lints.rust]
missing_docs = "warn"
unsafe_op_in_unsafe_fn = "forbid"

[workspace.lints.clippy]
# Lint Groups
all = "deny"
pedantic = "warn"
nursery = "warn"
cargo = "warn"
# Individual Lints
multiple_unsafe_ops_per_block = "forbid"
undocumented_unsafe_blocks = "forbid"
unnecessary_safety_doc = "forbid"

[workspace.lints.rustdoc]
bare_urls = "warn"
broken_intra_doc_links = "warn"
invalid_codeblock_attributes = "warn"
invalid_html_tags = "warn"
invalid_rust_codeblocks = "warn"
missing_crate_level_docs = "warn"
private_intra_doc_links = "warn"
redundant_explicit_links = "warn"
unescaped_backticks = "warn"
1 change: 1 addition & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CARGO_MAKE_SKIP_SLOW_SECONDARY_FLOWS = false
CARGO_MAKE_CLIPPY_ARGS = "--all-targets -- -D warnings"
RUSTFLAGS = "-D warnings"
CARGO_MAKE_RUST_DEFAULT_TOOLCHAIN = "stable"
RUSTDOCFLAGS = "-D warnings"

[tasks.wdk-pre-commit-flow]
description = "Run pre-commit tasks and checks"
Expand Down
3 changes: 3 additions & 0 deletions crates/sample-kmdf-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ wdk-build.workspace = true
[features]
default = []
nightly = ["wdk-macros/nightly", "wdk/nightly", "wdk-sys/nightly"]

[lints]
workspace = true
2 changes: 2 additions & 0 deletions crates/sample-kmdf-driver/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation
// License: MIT OR Apache-2.0

//! Build script for the `sample-kmdf-driver` crate.

fn main() -> Result<(), wdk_build::ConfigError> {
wdk_build::Config::from_env_auto()?.configure_binary_build()
}
13 changes: 5 additions & 8 deletions crates/sample-kmdf-driver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (c) Microsoft Corporation
// License: MIT OR Apache-2.0

//! # Sample KMDF Driver
//!
//! This is a sample KMDF driver that demonstrates how to use the crates in
//! windows-driver-rs to create a skeleton of a kmdf driver.

#![no_std]
#![deny(unsafe_op_in_unsafe_fn)]
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
#![deny(clippy::nursery)]
#![deny(clippy::cargo)]
#![deny(clippy::undocumented_unsafe_blocks)]
#![deny(clippy::unnecessary_safety_doc)]
#![deny(clippy::multiple_unsafe_ops_per_block)]

extern crate alloc;

Expand Down
3 changes: 3 additions & 0 deletions crates/wdk-alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ wdk-sys.workspace = true

[dev-dependencies]
wdk-sys = { workspace = true, features = ["test-stubs"] }

[lints]
workspace = true
Loading
Loading