Skip to content

Commit b5f5c91

Browse files
committed
chore: consolidate workspace settings
* Move common workspace settings to the `[workspace]` sections in the root. * Remove Cargo settings that are identical to the defaults (per Cargo [recommendations](https://doc.rust-lang.org/cargo/reference/manifest.html)) * Add common clippy lint configuration
1 parent bf63904 commit b5f5c91

File tree

4 files changed

+52
-30
lines changed

4 files changed

+52
-30
lines changed

Cargo.toml

+32-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
[package]
22
name = "libc"
33
version = "1.0.0-alpha.1"
4-
authors = ["The Rust Project Developers"]
5-
license = "MIT OR Apache-2.0"
6-
readme = "README.md"
7-
edition = "2021"
8-
repository = "https://github.com/rust-lang/libc"
9-
homepage = "https://github.com/rust-lang/libc"
10-
documentation = "https://docs.rs/libc/"
114
keywords = ["libc", "ffi", "bindings", "operating", "system"]
125
categories = ["external-ffi-bindings", "no-std", "os"]
13-
build = "build.rs"
146
exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml"]
15-
rust-version = "1.63"
167
description = "Raw FFI bindings to platform libraries like libc."
178
publish = false # On the main branch, we don't want to publish anything
9+
authors.workspace = true
10+
edition.workspace = true
11+
license.workspace = true
12+
repository.workspace = true
13+
rust-version.workspace = true
1814

1915
[package.metadata.docs.rs]
2016
features = ["extra_traits"]
@@ -140,9 +136,36 @@ std = []
140136
rustc-dep-of-std = ["rustc-std-workspace-core"]
141137
extra_traits = []
142138

139+
[lints]
140+
workspace = true
141+
143142
[workspace]
144143
members = [
145144
"ctest",
146145
"ctest-test",
147146
"libc-test",
148147
]
148+
149+
[workspace.package]
150+
authors = ["The Rust Project Developers"]
151+
license = "MIT OR Apache-2.0"
152+
edition = "2021"
153+
repository = "https://github.com/rust-lang/libc"
154+
rust-version = "1.63"
155+
156+
[workspace.lints.rust]
157+
# TODO: make idents consistent in each file
158+
# unused_qualifications = "warn"
159+
160+
[workspace.lints.clippy]
161+
# TODO: all these are default lints and should probably be fixed
162+
identity_op = "allow"
163+
if_same_then_else = "allow"
164+
missing_safety_doc = "allow"
165+
non_minimal_cfg = "allow"
166+
precedence = "allow"
167+
redundant_field_names = "allow"
168+
redundant_static_lifetimes = "allow"
169+
unnecessary_cast = "allow"
170+
unused_unit = "allow"
171+
zero_ptr = "allow"

ctest-test/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
name = "ctest-test"
33
version = "0.1.0"
44
authors = ["Alex Crichton <[email protected]>"]
5-
build = "build.rs"
6-
edition = "2021"
75
publish = false
6+
edition.workspace = true
7+
8+
[lints]
9+
workspace = true
810

911
[build-dependencies]
1012
ctest = { path = "../ctest" }

ctest/Cargo.toml

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
[package]
22
name = "ctest"
33
version = "0.4.11"
4-
license = "MIT OR Apache-2.0"
5-
readme = "README.md"
6-
repository = "https://github.com/rust-lang/libc"
7-
homepage = "https://github.com/rust-lang/libc"
8-
documentation = "https://docs.rs/ctest"
9-
description = """
10-
Automated tests of FFI bindings.
11-
"""
4+
description = "Automated tests of FFI bindings."
125
exclude = ["CHANGELOG.md"]
13-
edition = "2021"
14-
rust-version = "1.63.0"
6+
edition.workspace = true
7+
license.workspace = true
8+
repository.workspace = true
9+
rust-version.workspace = true
10+
11+
[lints]
12+
workspace = true
1513

1614
[dependencies]
1715
garando_syntax = "0.1"

libc-test/Cargo.toml

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
[package]
22
name = "libc-test"
33
version = "0.1.0"
4-
edition = "2021"
5-
authors = ["The Rust Project Developers"]
6-
license = "MIT OR Apache-2.0"
7-
build = "build.rs"
4+
description = "A test crate for the libc crate."
85
publish = false
9-
repository = "https://github.com/rust-lang/libc"
10-
homepage = "https://github.com/rust-lang/libc"
11-
description = """
12-
A test crate for the libc crate.
13-
"""
6+
authors.workspace = true
7+
edition.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
11+
[lints]
12+
workspace = true
1413

1514
[dependencies]
1615
cfg-if = "1.0.0"

0 commit comments

Comments
 (0)