ci: move lints to new 1.74 cargo.toml tables

This commit is contained in:
David Hewitt 2023-11-17 15:21:09 +00:00
parent d89c38822e
commit a9305ab389
9 changed files with 42 additions and 33 deletions

View File

@ -1,20 +0,0 @@
[target.'cfg(feature = "cargo-clippy")']
rustflags = [
# Lints to enforce in CI
"-Dclippy::checked_conversions",
"-Dclippy::dbg_macro",
"-Dclippy::explicit_into_iter_loop",
"-Dclippy::explicit_iter_loop",
"-Dclippy::filter_map_next",
"-Dclippy::flat_map_option",
"-Dclippy::let_unit_value",
"-Dclippy::manual_assert",
"-Dclippy::manual_ok_or",
"-Dclippy::todo",
"-Dclippy::unnecessary_wraps",
"-Dclippy::useless_transmute",
"-Dclippy::used_underscore_binding",
"-Delided_lifetimes_in_paths",
"-Dunused_lifetimes",
"-Drust_2021_prelude_collisions"
]

View File

@ -62,7 +62,7 @@ jobs:
run: echo "TRYBUILD=overwrite" >> "$GITHUB_ENV" run: echo "TRYBUILD=overwrite" >> "$GITHUB_ENV"
- name: Build docs - name: Build docs
run: cargo doc --no-deps --no-default-features --features "full ${{ inputs.extra-features }}" run: nox -s docs
- name: Build (no features) - name: Build (no features)
run: cargo build --lib --tests --no-default-features run: cargo build --lib --tests --no-default-features

View File

@ -127,3 +127,32 @@ members = [
no-default-features = true no-default-features = true
features = ["macros", "num-bigint", "num-complex", "hashbrown", "serde", "multiple-pymethods", "indexmap", "eyre", "chrono", "rust_decimal"] features = ["macros", "num-bigint", "num-complex", "hashbrown", "serde", "multiple-pymethods", "indexmap", "eyre", "chrono", "rust_decimal"]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
[workspace.lints.clippy]
checked_conversions = "warn"
dbg_macro = "warn"
explicit_into_iter_loop = "warn"
explicit_iter_loop = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
let_unit_value = "warn"
manual_assert = "warn"
manual_ok_or = "warn"
todo = "warn"
unnecessary_wraps = "warn"
useless_transmute = "warn"
used_underscore_binding = "warn"
[workspace.lints.rust]
elided_lifetimes_in_paths = "warn"
invalid_doc_attributes = "warn"
rust_2018_idioms = "warn"
rust_2021_prelude_collisions = "warn"
unused_lifetimes = "warn"
[workspace.lints.rustdoc]
broken_intra_doc_links = "warn"
bare_urls = "warn"
[lints]
workspace = true

View File

@ -36,6 +36,8 @@ abi3-py311 = ["abi3", "pyo3-build-config/abi3-py311"]
# Automatically generates `python3.dll` import libraries for Windows targets. # Automatically generates `python3.dll` import libraries for Windows targets.
generate-import-lib = ["pyo3-build-config/python3-dll-a"] generate-import-lib = ["pyo3-build-config/python3-dll-a"]
[build-dependencies] [build-dependencies]
pyo3-build-config = { path = "../pyo3-build-config", version = "0.20.0", features = ["resolve-config"] } pyo3-build-config = { path = "../pyo3-build-config", version = "0.20.0", features = ["resolve-config"] }
[lints]
workspace = true

View File

@ -25,3 +25,6 @@ features = ["derive", "parsing", "printing", "clone-impls", "full", "extra-trait
[features] [features]
abi3 = [] abi3 = []
[lints]
workspace = true

View File

@ -23,3 +23,6 @@ proc-macro2 = { version = "1", default-features = false }
quote = "1" quote = "1"
syn = { version = "2", features = ["full", "extra-traits"] } syn = { version = "2", features = ["full", "extra-traits"] }
pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.20.0" } pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.20.0" }
[lints]
workspace = true

View File

@ -2,8 +2,6 @@
//! must not contain any other public items. //! must not contain any other public items.
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
extern crate proc_macro;
use proc_macro::TokenStream; use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2; use proc_macro2::TokenStream as TokenStream2;
use pyo3_macros_backend::{ use pyo3_macros_backend::{

View File

@ -15,3 +15,6 @@ pyo3-build-config = { path = "../pyo3-build-config" }
[lib] [lib]
name = "pyo3_pytests" name = "pyo3_pytests"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[lints]
workspace = true

View File

@ -1,15 +1,6 @@
#![warn(missing_docs)] #![warn(missing_docs)]
#![cfg_attr(feature = "nightly", feature(auto_traits, negative_impls))] #![cfg_attr(feature = "nightly", feature(auto_traits, negative_impls))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(
docsrs, // rustdoc:: is not supported on msrv
deny(
invalid_doc_attributes,
rustdoc::broken_intra_doc_links,
rustdoc::bare_urls
)
)]
#![warn(rust_2018_idioms, unused_lifetimes)]
// Deny some lints in doctests. // Deny some lints in doctests.
// Use `#[allow(...)]` locally to override. // Use `#[allow(...)]` locally to override.
#![doc(test(attr( #![doc(test(attr(