Skip to content

Commit fddce20

Browse files
emilkclaude
andcommitted
feat: enable clippy::large_digit_groups
Enforces uniform digit grouping in long literals, where an odd group is usually a typo. The three existing hits are deliberate: the grouping spells out the decimal scale, so `180_00000000` reads as 180 with scale 8. They get `#[expect]`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 2758248 commit fddce20

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ iter_not_returning_iterator = "warn"
250250
iter_on_empty_collections = "warn"
251251
iter_on_single_items = "warn"
252252
iter_without_into_iter = "warn"
253+
large_digit_groups = "warn"
253254
# Detects large stack-allocated futures that may cause stack overflow crashes (see threshold in clippy.toml)
254255
large_futures = "warn"
255256
large_include_file = "warn"

‎datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ mod tests {
173173
}
174174

175175
#[test]
176+
#[expect(
177+
clippy::large_digit_groups,
178+
reason = "The grouping spells out the decimal scale, e.g. 180_00000000 is 180 with scale 8"
179+
)]
176180
fn test_decimal64_distinct_avg_accumulator() -> Result<()> {
177181
let precision = 10_u8;
178182
let scale = 4_i8;
@@ -202,6 +206,10 @@ mod tests {
202206
}
203207

204208
#[test]
209+
#[expect(
210+
clippy::large_digit_groups,
211+
reason = "The grouping spells out the decimal scale, e.g. 180_00000000 is 180 with scale 8"
212+
)]
205213
fn test_decimal128_distinct_avg_accumulator() -> Result<()> {
206214
let precision = 10_u8;
207215
let scale = 4_i8;
@@ -231,6 +239,10 @@ mod tests {
231239
}
232240

233241
#[test]
242+
#[expect(
243+
clippy::large_digit_groups,
244+
reason = "The grouping spells out the decimal scale, e.g. 180_00000000 is 180 with scale 8"
245+
)]
234246
fn test_decimal256_distinct_avg_accumulator() -> Result<()> {
235247
let precision = 50_u8;
236248
let scale = 2_i8;

0 commit comments

Comments
 (0)