Skip to content

Commit

Permalink
allow needless raw string hashes and unnecessary wraps (#1969)
Browse files Browse the repository at this point in the history
This change updates our root clippy config and removes the individual
overrides for `needless_raw_string_hashes`. It also preemptively allows
`unnecessary_wraps` in anticipation of #1954
  • Loading branch information
sezna authored Oct 17, 2024
1 parent 74c488b commit e4df79d
Show file tree
Hide file tree
Showing 116 changed files with 2 additions and 222 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ unwrap_used = "warn"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
needless_raw_string_hashes = "allow"
unnecessary_wraps = "allow"

[profile.release]
debug = "limited"
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc/src/interpret/debug/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use indoc::indoc;
use miette::Result;
use qsc_data_structures::{language_features::LanguageFeatures, target::TargetCapabilityFlags};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc/src/interpret/debugger_tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::interpret::Debugger;
use crate::line_column::Encoding;
use qsc_data_structures::language_features::LanguageFeatures;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc/src/interpret/package_tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::{interpret::Interpreter, packages::BuildableProgram};
use indoc::indoc;
use qsc_data_structures::{language_features::LanguageFeatures, target::TargetCapabilityFlags};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc/src/interpret/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

mod given_interpreter {
use crate::interpret::{InterpretResult, Interpreter};
use expect_test::Expect;
Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_codegen/src/qsharp/spec_decls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

#![allow(clippy::too_many_lines)]
#![allow(clippy::needless_raw_string_hashes)]

use expect_test::expect;
use indoc::indoc;
Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_codegen/src/qsharp/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

#![allow(clippy::too_many_lines)]
#![allow(clippy::needless_raw_string_hashes)]

use std::sync::Arc;

Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_codegen/src/qsharp/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

#![allow(clippy::too_many_lines)]
#![allow(clippy::needless_raw_string_hashes)]

use expect_test::expect;
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_data_structures/src/namespaces/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// allowing needless raw hashes here because we auto-update these expected outputs
// and don't want to risk weird breakages

#![allow(clippy::needless_raw_string_hashes)]

use expect_test::expect;

use super::*;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_doc_gen/src/generate_docs/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::generate_docs;
use expect_test::expect;

Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_eval/src/intrinsic/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use std::f64::consts;

use crate::backend::{Backend, SparseSim};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_eval/src/state/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{
get_matrix_latex, get_state_latex, write_latex_for_algebraic_number,
write_latex_for_cartesian_form, write_latex_for_complex_number, write_latex_for_decimal_number,
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_eval/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::{
backend::{Backend, SparseSim},
debug::Frame,
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_frontend/src/compile/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

mod multiple_packages;

use std::sync::Arc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_frontend/src/error/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::WithSource;
use crate::compile::SourceMap;
use expect_test::expect;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_frontend/src/lower/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::compile::{self, compile, PackageStore, SourceMap};
use expect_test::{expect, Expect};
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_frontend/src/resolve/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{Error, Locals, Names, Res};
use crate::{
compile,
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_frontend/src/typeck/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::{
compile::{self, Offsetter},
resolve::{self, Resolver},
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_parse/src/expr/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::expr;
use crate::tests::check;
use expect_test::expect;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_parse/src/item/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{
parse, parse_attr, parse_implicit_namespace, parse_import_or_export, parse_open,
parse_spec_decl,
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_parse/src/lex/cooked/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{Lexer, Token, TokenKind};
use crate::lex::Delim;
use expect_test::{expect, Expect};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_parse/src/lex/raw/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::Lexer;
use crate::lex::raw::{Single, Token, TokenKind};
use expect_test::{expect, Expect};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_parse/src/stmt/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{parse, parse_block};
use crate::tests::check;
use expect_test::expect;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/classical_args.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{assert_block_instructions, assert_callable, get_rir_program};
use expect_test::expect;
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{assert_block_instructions, assert_blocks, assert_callable, get_rir_program};
use expect_test::{expect, Expect};
use indoc::{formatdoc, indoc};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/loops.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{assert_block_instructions, assert_callable, get_rir_program};
use expect_test::expect;
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/operators.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{
assert_block_instructions, assert_blocks, assert_callable, assert_error,
get_partial_evaluation_error, get_rir_program,
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/output_recording.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{assert_error, get_partial_evaluation_error, get_rir_program};
use expect_test::expect;
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/qubits.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{assert_block_instructions, assert_callable, get_rir_program};
use expect_test::expect;
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_partial_eval/src/tests/results.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::{assert_block_instructions, assert_callable, get_rir_program};
use expect_test::expect;
use indoc::indoc;
Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_passes/src/baseprofck/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use expect_test::{expect, Expect};
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_passes/src/borrowck/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use expect_test::{expect, Expect};
use indoc::indoc;
use qsc_data_structures::{language_features::LanguageFeatures, target::TargetCapabilityFlags};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_passes/src/callable_limits/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use expect_test::{expect, Expect};
use indoc::indoc;
use qsc_data_structures::{language_features::LanguageFeatures, target::TargetCapabilityFlags};
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_passes/src/capabilitiesck/tests_adaptive.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::tests_common::{
check, check_for_exe, CALL_DYNAMIC_FUNCTION, CALL_DYNAMIC_OPERATION,
CALL_TO_CYCLIC_FUNCTION_WITH_CLASSICAL_ARGUMENT, CALL_TO_CYCLIC_FUNCTION_WITH_DYNAMIC_ARGUMENT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::capabilitiesck::tests_common::USE_DYNAMIC_RANGE;

use super::tests_common::{
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_passes/src/capabilitiesck/tests_base.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use super::tests_common::{
check, check_for_exe, CALL_DYNAMIC_FUNCTION, CALL_DYNAMIC_OPERATION,
CALL_TO_CYCLIC_FUNCTION_WITH_CLASSICAL_ARGUMENT, CALL_TO_CYCLIC_FUNCTION_WITH_DYNAMIC_ARGUMENT,
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_passes/src/capabilitiesck/tests_common.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use expect_test::Expect;

use crate::capabilitiesck::check_supported_capabilities;
Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_passes/src/conjugate_invert/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

#![allow(clippy::too_many_lines)]
#![allow(clippy::needless_raw_string_hashes)]

use expect_test::{expect, Expect};
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_passes/src/entry_point/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::{entry_point::generate_entry_expr, PackageType};
use expect_test::{expect, Expect};
use indoc::indoc;
Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_passes/src/logic_sep/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

#![allow(clippy::too_many_lines)]
#![allow(clippy::needless_raw_string_hashes)]

use expect_test::{expect, Expect};
use qsc_data_structures::{
Expand Down
1 change: 0 additions & 1 deletion compiler/qsc_passes/src/spec_gen/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

#![allow(clippy::too_many_lines)]
#![allow(clippy::needless_raw_string_hashes)]

use expect_test::{expect, Expect};
use indoc::indoc;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_qasm3/src/tests/declaration.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

mod array;
mod bit;
mod bool;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_qasm3/src/tests/declaration/bit.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::tests::compile_qasm_stmt_to_qsharp;
use expect_test::expect;
use miette::Report;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_qasm3/src/tests/declaration/bool.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::tests::compile_qasm_stmt_to_qsharp;

use expect_test::expect;
Expand Down
2 changes: 0 additions & 2 deletions compiler/qsc_qasm3/src/tests/declaration/complex.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#![allow(clippy::needless_raw_string_hashes)]

use crate::tests::compile_qasm_stmt_to_qsharp;

use expect_test::expect;
Expand Down
Loading

0 comments on commit e4df79d

Please sign in to comment.