Add more lints

This commit is contained in:
Joscha 2024-12-04 17:14:15 +01:00
parent 85c93ee01d
commit 8506a231dd
6 changed files with 27 additions and 11 deletions

View file

@ -40,3 +40,25 @@ required-features = ["bot"]
[[example]] [[example]]
name = "testbot_commands" name = "testbot_commands"
required-features = ["bot"] required-features = ["bot"]
[lints]
rust.unsafe_code = { level = "forbid", priority = 1 }
# Lint groups
rust.deprecated_safe = "warn"
rust.future_incompatible = "warn"
rust.keyword_idents = "warn"
rust.rust_2018_idioms = "warn"
rust.unused = "warn"
# Individual lints
rust.non_local_definitions = "warn"
rust.redundant_imports = "warn"
rust.redundant_lifetimes = "warn"
rust.single_use_lifetimes = "warn"
rust.unit_bindings = "warn"
rust.unnameable_types = "warn"
rust.unused_crate_dependencies = "warn"
rust.unused_import_braces = "warn"
rust.unused_lifetimes = "warn"
rust.unused_qualifications = "warn"
# Clippy
clippy.use_self = "warn"

View file

@ -1,3 +1,5 @@
#![allow(unused_crate_dependencies)]
// TODO Add description // TODO Add description
// TODO Clean up and unify test bots // TODO Clean up and unify test bots

View file

@ -1,5 +1,6 @@
//! Similar to the `testbot_manual` example, but using [`Instance`] to connect //! Similar to the `testbot_manual` example, but using [`Instance`] to connect
//! to the room (and to reconnect). //! to the room (and to reconnect).
#![allow(unused_crate_dependencies)]
use euphoxide::api::packet::ParsedPacket; use euphoxide::api::packet::ParsedPacket;
use euphoxide::api::{Data, Nick, Send}; use euphoxide::api::{Data, Nick, Send};

View file

@ -1,5 +1,6 @@
//! Similar to the `testbot_manual` example, but using [`Instance`] to connect //! Similar to the `testbot_manual` example, but using [`Instance`] to connect
//! to the room (and to reconnect). //! to the room (and to reconnect).
#![allow(unused_crate_dependencies)]
use euphoxide::api::packet::ParsedPacket; use euphoxide::api::packet::ParsedPacket;
use euphoxide::api::{Data, Nick, Send}; use euphoxide::api::{Data, Nick, Send};

View file

@ -1,5 +1,6 @@
//! A small bot that doesn't use the `bot` submodule. Meant to show how the main //! A small bot that doesn't use the `bot` submodule. Meant to show how the main
//! parts of the API fit together. //! parts of the API fit together.
#![allow(unused_crate_dependencies)]
use std::error::Error; use std::error::Error;
use std::time::Duration; use std::time::Duration;

View file

@ -1,14 +1,3 @@
#![forbid(unsafe_code)]
// Rustc lint groups
#![warn(future_incompatible)]
#![warn(rust_2018_idioms)]
#![warn(unused)]
// Rustc lints
#![warn(noop_method_call)]
#![warn(single_use_lifetimes)]
// Clippy lints
#![warn(clippy::use_self)]
pub mod api; pub mod api;
#[cfg(feature = "bot")] #[cfg(feature = "bot")]
pub mod bot; pub mod bot;