chore: Add clippy lints (#529)

Lints are added (deny) at crate level.

In each offending file, the failing lints are explicitly allowed.
Each file will be fixed in subsequent PRs.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-23 15:59:34 -06:00
committed by GitHub
parent 604591a0f7
commit 249dcd0b43
121 changed files with 703 additions and 23 deletions

View File

@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(clippy::use_debug, clippy::pattern_type_mismatch)]
use crate::*;
type String = Rc<str>;

View File

@@ -1,6 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(
clippy::expect_used,
clippy::missing_const_for_fn,
clippy::option_if_let_else
)] // meta schema loader expects static resources
#![allow(dead_code)]
use crate::*;
use lazy_static::lazy_static;

View File

@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(clippy::unwrap_used, clippy::assertions_on_result_states)] // meta-schema tests unwrap errors to assert failures
use super::*;
use serde_json::json;

View File

@@ -1,6 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(
clippy::panic,
clippy::unwrap_used,
clippy::expect_used,
clippy::pattern_type_mismatch
)] // azure schema tests panic/unwrap to assert structures
use super::super::*;
#[test]

View File

@@ -1,6 +1,18 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(
clippy::panic,
clippy::unwrap_used,
clippy::expect_used,
clippy::indexing_slicing,
clippy::shadow_unrelated,
clippy::semicolon_if_nothing_returned,
clippy::pattern_type_mismatch,
clippy::assertions_on_result_states,
clippy::as_conversions
)] // schema suite tests panic/unwrap to assert specific error shapes
use super::super::*;
use crate::{format, vec};
use serde_json::json;

View File

@@ -1,6 +1,13 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(
clippy::unwrap_used,
clippy::panic,
clippy::pattern_type_mismatch,
clippy::assertions_on_result_states
)] // test cases assert failures via unwrap/expect panic paths and pattern matching
use crate::{
schema::{error::ValidationError, validate::SchemaValidator, Schema},
*,

View File

@@ -1,6 +1,16 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::shadow_unrelated,
clippy::pattern_type_mismatch,
clippy::assertions_on_result_states,
clippy::as_conversions
)] // test cases use unwrap/expect and panic to assert error flows
use crate::{
schema::{error::ValidationError, validate::SchemaValidator, Schema},
*,

View File

@@ -1,7 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![allow(missing_debug_implementations)] // validator is zero-sized marker
#![allow(dead_code)]
#![allow(clippy::pattern_type_mismatch, clippy::needless_continue)]
use crate::{
schema::{error::ValidationError, Schema, Type},