Check the entire workspace in `scripts/check`

6ce2923ffb01126ed4f7bea8a9085949cfe45af8
Assisted-by: Claude:claude-opus-4.7
Alexis Sellier committed ago 1 parent 2e8d96a3
clippy.toml added +5 -0
1 +
# Test code may freely use `unwrap`, `expect`, and `panic`; the matching
2 +
# restriction lints stay enabled for production code.
3 +
allow-unwrap-in-tests = true
4 +
allow-expect-in-tests = true
5 +
allow-panic-in-tests = true
crates/diff/src/decode.rs +0 -0
{ +0 -0
+0 -0
=> break, +0 -0
a.rs +0 -0
new.rs +0 -0
old.rs +0 -0
to.rs +0 -0
copy2.rs +0 -0
mode.sh +0 -0
image.png +0 -0
a +0 -0
a +0 -0
a +0 -0
a.rs +0 -0
b.rs +0 -0
a.rs\x1b[m +0 -0
crates/diff/src/viewer.rs +5 -1
642 642
643 643
    /// Applies an action to the viewer state.
644 644
    pub fn apply(&mut self, action: DiffAction, area: Rect) -> ViewChange {
645 645
        let before = self.state.clone();
646 646
        let before_visibility = self.file_tree_visibility;
647 +
        let before_file_tree = self.file_tree.clone();
647 648
        let layout = self.layout(area);
648 649
        let diff = layout.diff;
649 650
650 651
        match action {
651 652
            DiffAction::Scroll(scroll) => {
726 727
727 728
        if before.invalidates_index(&self.state) {
728 729
            self.rebuild_index();
729 730
            self.state.scroll = View::new(self.state.scroll, self.index.rows, diff.rows).offset;
730 731
        }
731 -
        if self.state == before && self.file_tree_visibility == before_visibility {
732 +
        if self.state == before
733 +
            && self.file_tree_visibility == before_visibility
734 +
            && self.file_tree == before_file_tree
735 +
        {
732 736
            ViewChange::Unchanged
733 737
        } else {
734 738
            ViewChange::Changed
735 739
        }
736 740
    }
a.rs +0 -0
a.rs +0 -0
b.rs +0 -0
a.rs +0 -0
a.rs +0 -0
a.rs +0 -0
b.rs +0 -0
src/a.rs +0 -0
src/b.rs +0 -0
README.md +0 -0
a.rs +0 -0
a.rs +0 -0
a.rs +0 -0
a.rs +0 -0
b.rs +0 -0
crates/diff/tests/golden/wide_file_tree_100x12.txt +1 -1
6 6
                             │      2     + new                                                   │▓
7 7
                             │      3     + extra                                                 │▓
8 8
╭──────────────────────────╮ │ 3    4       tail                                                  │▓
9 9
│ lines added    +3        │ ╰────────────────────────────────────────────────────────────────────╯▓
10 10
│ lines removed  -2        │ ╭────────────────────────────────────────────────────────────────────╮🮘
11 -
│ files changed  2         │ │ ⊙ b.rs                                                       +1 -1 │🮘
11 +
│ files changed   2        │ │ ⊙ b.rs                                                       +1 -1 │🮘
12 12
╰──────────────────────────╯ ├────────────────────────────────────────────────────────────────────┤🮘
crates/signals/src/lib.rs +0 -1
243 243
    }
244 244
    Ok(())
245 245
}
246 246
247 247
#[cfg(test)]
248 -
#[allow(clippy::unwrap_used)]
249 248
mod tests {
250 249
    use std::sync::Mutex;
251 250
    use std::time::Duration;
252 251
253 252
    use super::*;
crates/tui-core/src/primitive.rs +2 -0
447 447
448 448
    #[test]
449 449
    fn overlay_ranges_splits_labels_at_boundaries() {
450 450
        // Single label "hello world", overlay bg on bytes 0..5 ("hello").
451 451
        let line = Line::new(Label::new("hello world").fg(Color::Red));
452 +
        #[allow(clippy::single_range_in_vec_init)]
452 453
        let overlaid = line.overlay_ranges(&[0..5], Style::default().bg(Color::Blue));
453 454
        let labels = overlaid.labels();
454 455
        assert_eq!(labels.len(), 2);
455 456
        assert_eq!(labels[0].content(), "hello");
456 457
        assert_eq!(labels[0].paint.style.fg_color(), Color::Red);
464 465
    fn overlay_ranges_spans_label_boundaries() {
465 466
        // Range crosses two labels: "ab" + "cd", overlay 1..3 → covers "b"+"c".
466 467
        let line = Line::default()
467 468
            .item(Label::new("ab"))
468 469
            .item(Label::new("cd"));
470 +
        #[allow(clippy::single_range_in_vec_init)]
469 471
        let overlaid = line.overlay_ranges(&[1..3], Style::default().bg(Color::Green));
470 472
        let labels = overlaid.labels();
471 473
        let text: Vec<_> = labels.iter().map(|l| l.content()).collect();
472 474
        let bgs: Vec<_> = labels.iter().map(|l| l.paint.style.bg_color()).collect();
473 475
        assert_eq!(text, ["a", "b", "c", "d"]);
crates/tui-widgets/src/scrollview.rs +1 -1
424 424
        view.render(buffer.area(), &mut buffer);
425 425
426 426
        let thumb_rows = buffer
427 427
            .lines()
428 428
            .iter()
429 -
            .filter(|line| line.chars().last() == Some('#'))
429 +
            .filter(|line| line.ends_with('#'))
430 430
            .count();
431 431
        assert_eq!(thumb_rows, 5);
432 432
    }
433 433
}
scripts/check +4 -4
18 18
  printf '%s\n' "check failed: $name" >&2
19 19
  cat "$log" >&2
20 20
  exit 1
21 21
}
22 22
23 -
run "format" cargo fmt --check
24 -
run "clippy" cargo clippy --all-targets --all-features -- -D warnings
25 -
run "build" env RUSTFLAGS="-D warnings" cargo build --all-targets --all-features
26 -
run "test" env RUSTFLAGS="-D warnings" cargo test --all-targets --all-features
23 +
run "format" cargo fmt --all --check
24 +
run "clippy" cargo clippy --workspace --all-targets --all-features -- -D warnings
25 +
run "build" env RUSTFLAGS="-D warnings" cargo build --workspace --all-targets --all-features
26 +
run "test" env RUSTFLAGS="-D warnings" cargo test --workspace --all-targets --all-features
27 27
run "docs" env RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --document-private-items