Skip to content

Commit

Permalink
more test allows
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 10, 2025
1 parent c1a52bb commit 025fa10
Show file tree
Hide file tree
Showing 53 changed files with 205 additions and 36 deletions.
2 changes: 2 additions & 0 deletions components/calendar/benches/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

mod fixtures;

use criterion::{
Expand Down
2 changes: 2 additions & 0 deletions components/calendar/benches/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

mod fixtures;

use criterion::{
Expand Down
3 changes: 3 additions & 0 deletions components/calendar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
#![cfg_attr(not(any(test, feature = "std")), no_std)]

// TODO: until we can enable allow-indexing-slicing-in-tests
#![cfg_attr(test, allow(clippy::indexing_slicing))]

extern crate alloc;

// Make sure inherent docs go first
Expand Down
2 changes: 2 additions & 0 deletions components/collator/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

use core::cmp::Ordering;

use atoi::FromRadix16;
Expand Down
7 changes: 5 additions & 2 deletions components/collections/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
#![cfg_attr(not(any(test, feature = "std")), no_std)]

// TODO
#![allow(clippy::exhaustive_structs, clippy::exhaustive_enums, missing_debug_implementations)]
#![allow(
clippy::exhaustive_structs,
clippy::exhaustive_enums,
missing_debug_implementations
)]

extern crate alloc;

Expand Down
3 changes: 3 additions & 0 deletions components/datetime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
#![cfg_attr(not(any(test, feature = "std")), no_std)]

// TODO: until we can enable allow-indexing-slicing-in-tests
#![cfg_attr(test, allow(clippy::indexing_slicing))]

extern crate alloc;

mod combo;
Expand Down
2 changes: 2 additions & 0 deletions components/locale_core/benches/langid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

mod fixtures;
mod helpers;

Expand Down
2 changes: 2 additions & 0 deletions components/normalizer/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

use icu_normalizer::properties::CanonicalCombiningClassMap;
use icu_normalizer::properties::CanonicalCombiningClassMapBorrowed;
use icu_normalizer::properties::CanonicalComposition;
Expand Down
2 changes: 2 additions & 0 deletions components/plurals/tests/fixtures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

use fixed_decimal::SignedFixedDecimal;
#[cfg(feature = "experimental")]
use icu_plurals::PluralOperands;
Expand Down
5 changes: 4 additions & 1 deletion provider/blob/benches/auxkey_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981
#![allow(clippy::exhaustive_structs)]

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use icu_locale::LocaleFallbacker;
use icu_locale_core::{langid, LanguageIdentifier};
Expand All @@ -19,7 +22,7 @@ use std::collections::BTreeSet;
marker(MarkerC, "c@1"),
marker(MarkerD, "d@1")
)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, databake::Bake, PartialEq)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, databake::Bake, PartialEq, Debug)]
#[databake(path = crate)]
pub struct Empty;

Expand Down
2 changes: 2 additions & 0 deletions provider/blob/benches/blob_version_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

extern crate alloc;

use criterion::{black_box, criterion_group, criterion_main, Criterion};
Expand Down
2 changes: 2 additions & 0 deletions provider/blob/tests/test_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used)] // https://github.com/rust-lang/rust-clippy/issues/13981

use icu_locale::subtags::{region, script, Language};
use icu_locale_core::LanguageIdentifier;
use icu_provider::dynutil::UpcastDataPayload;
Expand Down
8 changes: 6 additions & 2 deletions provider/core/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
//! These macros are re-exported from `icu_provider`.
// Proc macro
#![allow(clippy::indexing_slicing, clippy::panic, clippy::unwrap_used, clippy::expect_used)]

#![allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
clippy::expect_used
)]

extern crate proc_macro;
use proc_macro::TokenStream;
Expand Down
7 changes: 6 additions & 1 deletion provider/export/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
//! * enables parallelism during export
// Primarily used in datagen
#![allow(clippy::indexing_slicing, clippy::panic, clippy::unwrap_used, clippy::expect_used)]
#![allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
clippy::expect_used
)]

mod export_impl;
mod locale_family;
Expand Down
2 changes: 2 additions & 0 deletions provider/export/tests/test-options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

#[path = "testutil.rs"]
mod testutil;

Expand Down
3 changes: 3 additions & 0 deletions provider/export/tests/testutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981
#![allow(missing_debug_implementations)]

use std::collections::BTreeMap;

use elsa::sync::FrozenMap;
Expand Down
7 changes: 7 additions & 0 deletions provider/fs/benches/provider_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::indexing_slicing
)] // https://github.com/rust-lang/rust-clippy/issues/13981

use criterion::{black_box, criterion_group, criterion_main, Criterion};

use icu_locale_core::langid;
Expand Down
9 changes: 6 additions & 3 deletions provider/icu4x-datagen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@
not(any(feature = "provider", feature = "blob_input",)),
allow(unused_assignments, unreachable_code, unused_variables)
)]

// Primarily used in datagen
#![allow(clippy::indexing_slicing, clippy::panic, clippy::unwrap_used, clippy::expect_used)]

#![allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
clippy::expect_used
)]

use clap::{Parser, ValueEnum};
use eyre::WrapErr;
Expand Down
7 changes: 6 additions & 1 deletion provider/source/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
//! * enables markers defined in the unstable `icu::experimental` module
// Primarily used in datagen
#![allow(clippy::indexing_slicing, clippy::panic, clippy::unwrap_used, clippy::expect_used)]
#![allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
clippy::expect_used
)]

use cldr_cache::CldrCache;
use elsa::sync::FrozenMap;
Expand Down
7 changes: 6 additions & 1 deletion utils/databake/derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
//! Custom derives for `Bake`
// Proc macro
#![allow(clippy::indexing_slicing, clippy::panic, clippy::unwrap_used, clippy::expect_used)]
#![allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
clippy::expect_used
)]

use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
Expand Down
7 changes: 6 additions & 1 deletion utils/deduplicating_array/examples/postcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
// This example demonstrates how to use deduplicating_array

// Example code
#![allow(clippy::indexing_slicing, clippy::panic, clippy::unwrap_used, clippy::expect_used)]
#![allow(
clippy::indexing_slicing,
clippy::panic,
clippy::unwrap_used,
clippy::expect_used
)]

#[derive(serde::Serialize, serde::Deserialize)]
struct DataStruct {
Expand Down
2 changes: 2 additions & 0 deletions utils/fixed_decimal/benches/fixed_decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

use core::str::FromStr;
use rand::SeedableRng;
use rand_distr::{Distribution, Triangular};
Expand Down
1 change: 0 additions & 1 deletion utils/fixed_decimal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
#![cfg_attr(not(any(test, feature = "std")), no_std)]

// TODO
#![allow(missing_docs)]

Expand Down
3 changes: 0 additions & 3 deletions utils/ixdtf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,9 @@
//! [temporal-grammar]: https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar
#![no_std]

// TODO: until we can enable allow-indexing-slicing-in-tests
#![cfg_attr(test, allow(clippy::indexing_slicing))]



mod error;
pub mod parsers;

Expand Down
2 changes: 2 additions & 0 deletions utils/litemap/benches/litemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used)] // https://github.com/rust-lang/rust-clippy/issues/13981

use criterion::{black_box, criterion_group, criterion_main, Criterion};

use litemap::LiteMap;
Expand Down
1 change: 1 addition & 0 deletions utils/litemap/examples/litemap_bincode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// LiteMap is intended as a small and low-memory drop-in replacement for
// HashMap. This example demonstrates how it works with Serde.

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981
#![no_main] // https://github.com/unicode-org/icu4x/issues/395
icu_benchmark_macros::instrument!();

Expand Down
1 change: 1 addition & 0 deletions utils/litemap/examples/litemap_postcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// LiteMap is intended as a small and low-memory drop-in replacement for
// HashMap. This example demonstrates how it works with Serde.

#![allow(clippy::unwrap_used, clippy::expect_used)] // https://github.com/rust-lang/rust-clippy/issues/13981
#![no_main] // https://github.com/unicode-org/icu4x/issues/395
icu_benchmark_macros::instrument!();

Expand Down
2 changes: 2 additions & 0 deletions utils/litemap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
#![cfg_attr(not(test), no_std)]
// TODO: until we can enable allow-indexing-slicing-in-tests
#![cfg_attr(test, allow(clippy::indexing_slicing))]

// for intra doc links
#[cfg(doc)]
Expand Down
2 changes: 2 additions & 0 deletions utils/litemap/tests/rkyv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::indexing_slicing)] // https://github.com/rust-lang/rust-clippy/issues/13981

use litemap::LiteMap;
use rkyv::archived_root;
use rkyv::check_archived_root;
Expand Down
2 changes: 2 additions & 0 deletions utils/resb/examples/genrb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] // https://github.com/rust-lang/rust-clippy/issues/13981

use std::{
fs::File,
io::{BufReader, BufWriter, Read, Write},
Expand Down
Loading

0 comments on commit 025fa10

Please sign in to comment.