Skip to content

Commit 69dadd8

Browse files
committed
Address latest linting issues
1 parent 5976f3d commit 69dadd8

File tree

6 files changed

+45
-53
lines changed

6 files changed

+45
-53
lines changed

Cargo.toml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -85,46 +85,64 @@ assets = [
8585

8686
[lints.rust]
8787
future_incompatible = { level = "warn", priority = -2 }
88+
keyword_idents = { level = "warn", priority = -3 }
89+
let_underscore = { level = "warn", priority = -2 }
8890
nonstandard_style = { level = "warn", priority = -2 }
91+
# refiing_impl_trait - Not needed for this project
8992
rust_2018_compatibility = { level = "warn", priority = -2 }
9093
rust_2018_idioms = { level = "warn", priority = -2 }
9194
rust_2021_compatibility = { level = "warn", priority = -2 }
95+
rust_2024_compatibility = { level = "warn", priority = -2 }
9296
unused = { level = "warn", priority = -2 }
9397

9498
unknown_lints = { level = "warn", priority = -1 }
9599
renamed_and_removed_lints = { level = "warn", priority = -1 }
96100

97-
absolute_paths_not_starting_with_crate = "warn"
101+
# Allow certain configs in the check-cfg linting
102+
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"] }
103+
104+
# absolute_paths_not_starting_with_crate - group rust_2018_compatibility
105+
# box-pointers - used in project, and is safe to do so
98106
deprecated_in_future = "warn"
99-
dead_code = "warn"
100-
elided_lifetimes_in_paths = "warn"
101-
explicit_outlives_requirements = "warn"
107+
# elided_lifetimes_in_paths - group: rust_2018_idioms
108+
# explicit_outlives_requirements - group: rust_2018_idioms
102109
ffi_unwind_calls = "warn"
103-
keyword_idents = "warn"
104-
let_underscore_drop = "warn"
110+
# fuzzy_provenance_casts - unstable
111+
# impl_trait_overcaptures - unstable
112+
# keyword_idents_2018 - group: rust_2018_compatibility
113+
# keyword_idents_2024 - group: rust_2024_compatibility
114+
# let_underscore_drop - group: let_underscore
115+
# lossy_provenance_casts - unstable
105116
macro_use_extern_crate = "warn"
106117
meta_variable_misuse = "warn"
107118
missing_abi = "warn"
108119
missing_copy_implementations = "warn"
109120
missing_debug_implementations = "warn"
121+
# missing_docs - not requiring docs in this project
122+
# multiple_supertrait_upcastable - unstable
123+
# must_not_suspend - unstable
110124
non_ascii_idents = "warn"
111-
noop_method_call = "warn"
112-
pointer_structural_match = "warn"
113-
rust_2021_incompatible_closure_captures = "warn"
114-
rust_2021_incompatible_or_patterns = "warn"
115-
rust_2021_prefixes_incompatible_syntax = "warn"
116-
rust_2021_prelude_collisions = "warn"
125+
# non_exhaustive_omitted_patterns - unstable
126+
redundant_lifetimes = "warn"
127+
# rust_2021_incompatible_closure_captures - group: rust_2021_compatibility
128+
# rust_2021_incompatible_or_patterns - group: rust_2021_compatibility
129+
# rust_2021_prefixes_incompatible_syntax - group: rust_2021_compatibility
130+
# rust_2021_prelude_collisions - group: rust_2021_compatibility
131+
# rust_2024_incompatible_pat - unstable
117132
single_use_lifetimes = "warn"
118133
trivial_casts = "warn"
119134
trivial_numeric_casts = "warn"
135+
unit-bindings = "warn"
136+
unnameable_types = "warn"
120137
unreachable_pub = "warn"
121138
unsafe_code = "warn"
122-
unsafe_op_in_unsafe_fn = "warn"
139+
# unsafe_op_in_unsafe_fn - group: rust_2024_compatibility
140+
# unstable_features - deprecated
123141
unused_crate_dependencies = "warn"
124-
unused_extern_crates = "warn"
142+
# unused_extern_crates - group: unused, rust_2018_idioms
125143
unused_import_braces = "warn"
126144
unused_lifetimes = "warn"
127-
unused_macro_rules = "warn"
145+
# unused_macro_rules - group: unused
128146
unused_qualifications = "warn"
129147
unused_results = "warn"
130148
variant_size_differences = "warn"
@@ -135,7 +153,9 @@ cargo = { level = "warn", priority = -2 }
135153
pedantic = { level = "warn", priority = -2 }
136154
restriction = { level = "warn", priority = -2 }
137155

156+
# Clippy restricts enabling restricted lints
138157
blanket_clippy_restriction_lints = { level = "allow", priority = 5 }
158+
139159
absolute_paths = "allow"
140160
as_conversions = "allow"
141161
arithmetic_side_effects = "allow"
@@ -146,6 +166,7 @@ expect_used = "allow"
146166
float_arithmetic = "allow"
147167
implicit_return = "allow"
148168
indexing_slicing = "allow"
169+
integer_division_remainder_used = "allow"
149170
map_err_ignore = "allow"
150171
min_ident_chars = "allow"
151172
missing_docs_in_private_items = "allow"

build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use chrono::{TimeZone, Utc};
44
use rustc_version::{version_meta, Channel};
55

66
fn main() {
7+
println!("cargo::rustc-check-cfg=cfg(allow_unknown_lints)");
8+
println!("cargo::rustc-check-cfg=cfg(include_nightly_lints)");
79
// allow unknown lints in nightly builds
810
if let Ok(meta) = version_meta() {
911
if meta.channel == Channel::Nightly {

ignored-lints.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/exit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
use crate::module::ExitStatus;
22

33
#[derive(Debug, PartialEq, Eq)]
4-
pub struct Exit {
4+
pub(crate) struct Exit {
55
message: Option<String>,
66
status: ExitStatus,
77
}
88

99
impl Exit {
10-
pub fn new(status: ExitStatus, message: &str) -> Self {
10+
pub(crate) fn new(status: ExitStatus, message: &str) -> Self {
1111
Self {
1212
message: Some(String::from(message)),
1313
status,
1414
}
1515
}
1616

17-
pub const fn get_message(&self) -> &Option<String> {
17+
pub(crate) const fn get_message(&self) -> &Option<String> {
1818
&self.message
1919
}
2020

21-
pub const fn get_status(&self) -> &ExitStatus {
21+
pub(crate) const fn get_status(&self) -> &ExitStatus {
2222
&self.status
2323
}
2424
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use crate::{
6060
};
6161

6262
#[must_use]
63-
pub fn run(os_args: Vec<OsString>) -> Exit {
63+
fn run(os_args: Vec<OsString>) -> Exit {
6464
match Args::try_from(os_args) {
6565
Err(err) => err,
6666
Ok(args) => {

src/module/exit_status.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2-
pub enum ExitStatus {
2+
pub(crate) enum ExitStatus {
33
None,
44
Abort,
55
ConfigError,
@@ -11,7 +11,7 @@ pub enum ExitStatus {
1111
}
1212

1313
impl ExitStatus {
14-
pub const fn to_code(self) -> i32 {
14+
pub(crate) const fn to_code(self) -> i32 {
1515
match self {
1616
Self::Abort => 5,
1717
Self::ConfigError => 1,

0 commit comments

Comments
 (0)