1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 06:16:17 +03:00

fix contributing guide and clippy warnings in tests

Этот коммит содержится в:
rhysd
2023-10-02 14:46:29 +09:00
родитель df5d6aed11
Коммит 385ed43f74
6 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@@ -1,3 +1,3 @@
[alias]
watch-check = ["watch", "-x", "check --examples --features ratatui-crossterm,search --no-default-features --tests", "-x", "check --examples --features search --tests"]
watch-test = ["watch", "-x", "test --features=search -- --skip=src/lib.rs", "-w", "src"]
watch-check = ["watch", "-x", "clippy --features ratatui-crossterm,search --no-default-features --examples --tests", "-x", "clippy --features search --examples --tests"]
watch-test = ["watch", "-x", "test --features=search -- --skip=src/lib.rs", "-w", "src", "-w", "tests"]

Просмотреть файл

@@ -29,13 +29,15 @@ cargo test --features=search -- --skip src/lib.rs
To run linters:
```sh
cargo clippy --all-features --examples
cargo clippy --features=search --tests --examples
cargo clippy --features=ratatui-crossterm,search --no-default-features --tests --examples
cargo fmt -- --check
```
If you use [cargo-watch][], `cargo watch-check` alias is useful to run checks automatically on writing to a file.
If you use [cargo-watch][], `cargo watch-check` and `cargo watch-test` aliases are useful to run checks/tests automatically
on writing to a file.
## Print debug
## Print debugging
Since this crate uses stdout, `println!` is not available for debugging. Instead, stderr through [`eprintln!`][eprintln]
or [`dbg!`][dbg] are useful.

Просмотреть файл

@@ -673,7 +673,7 @@ This project is developed [on GitHub][repo].
For feature requests or bug reports, please [create an issue][new-issue]. For submitting patches, please [create a pull
request][pulls].
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) before making a PR.
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) before reporting an issue or making a PR.
## License

Просмотреть файл

@@ -332,14 +332,14 @@ mod tests {
use crate::tui::widgets::Widget;
use crate::{CursorMove, TextArea};
let mut textarea: TextArea = (0..20).into_iter().map(|i| i.to_string()).collect();
let mut textarea: TextArea = (0..20).map(|i| i.to_string()).collect();
let r = Rect {
x: 0,
y: 0,
width: 24,
height: 8,
};
let mut b = Buffer::empty(r.clone());
let mut b = Buffer::empty(r);
textarea.widget().render(r, &mut b);
textarea.move_cursor(CursorMove::Bottom);

Просмотреть файл

@@ -193,14 +193,14 @@ mod tests {
use crate::tui::widgets::Widget;
use crate::TextArea;
let mut textarea: TextArea = (0..20).into_iter().map(|i| i.to_string()).collect();
let mut textarea: TextArea = (0..20).map(|i| i.to_string()).collect();
let r = Rect {
x: 0,
y: 0,
width: 24,
height: 8,
};
let mut b = Buffer::empty(r.clone());
let mut b = Buffer::empty(r);
textarea.widget().render(r, &mut b);
textarea.scroll(Scrolling::Delta { rows: 2, cols: 0 });

Просмотреть файл

@@ -1690,14 +1690,14 @@ mod tests {
use crate::tui::layout::Rect;
use crate::tui::widgets::Widget;
let mut textarea: TextArea = (0..20).into_iter().map(|i| i.to_string()).collect();
let mut textarea: TextArea = (0..20).map(|i| i.to_string()).collect();
let r = Rect {
x: 0,
y: 0,
width: 24,
height: 8,
};
let mut b = Buffer::empty(r.clone());
let mut b = Buffer::empty(r);
textarea.widget().render(r, &mut b);
textarea.scroll((15, 0));