From 7e96d9b5dc90c10de3f7bd88bd3ec71fc67a63e5 Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:54:22 +0900 Subject: [PATCH 1/5] add typos setting --- .typos.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .typos.toml diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..502d82b --- /dev/null +++ b/.typos.toml @@ -0,0 +1,13 @@ +# configuration for https://github.com/crate-ci/typos + + +[default.extend-words] +syntact = "syntact" +zhobo = "zhobo" +ratatui = "ratatui" + + +[type.md] +extend-ignore-re = [ + "\\[[[:xdigit:]]{7}\\]\\(https://github.com/ratatui-org/ratatui/commit/[[:xdigit:]]{40}\\)", +] \ No newline at end of file From 63301bf9597bff1ad7cb4e8c71db6d2373cde58a Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:32:45 +0900 Subject: [PATCH 2/5] fix typos --- src/components/databases.rs | 6 +++--- src/components/table.rs | 4 ++-- src/components/table_filter.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/databases.rs b/src/components/databases.rs index c3c9856..b659670 100644 --- a/src/components/databases.rs +++ b/src/components/databases.rs @@ -375,7 +375,7 @@ mod test { } #[test] - fn test_filterd_tree_item_to_span() { + fn test_filtered_tree_item_to_span() { const WIDTH: u16 = 10; assert_eq!( DatabasesComponent::tree_item_to_span( @@ -397,7 +397,7 @@ mod test { Some("rb".to_string()), ), Line::from(vec![ - Span::raw(format!(" {}", "ba")), + Span::raw(format!(" {}", "by")), Span::styled("rb", Style::default().fg(Color::Blue)), Span::raw(format!("{:w$}", "az", w = WIDTH as usize)) ]) @@ -423,7 +423,7 @@ mod test { Some("rb".to_string()), ), Line::from(vec![ - Span::styled(format!(" {}", "ba"), Style::default().bg(Color::Blue)), + Span::styled(format!(" {}", "by"), Style::default().bg(Color::Blue)), Span::styled("rb", Style::default().bg(Color::Blue).fg(Color::Blue)), Span::styled( format!("{:w$}", "az", w = WIDTH as usize), diff --git a/src/components/table.rs b/src/components/table.rs index 40f781e..ec6d7e6 100644 --- a/src/components/table.rs +++ b/src/components/table.rs @@ -148,7 +148,7 @@ impl TableComponent { headers: Vec, database: Database, table: DTable, - hold_cusor_position: bool, + hold_cursor_position: bool, ) { self.selected_row.select(None); if !rows.is_empty() { @@ -157,7 +157,7 @@ impl TableComponent { self.headers = headers; self.rows = rows; self.total_row_count = total_row_count; - self.selected_column = if hold_cusor_position { + self.selected_column = if hold_cursor_position { self.selected_column } else { 0 diff --git a/src/components/table_filter.rs b/src/components/table_filter.rs index 61d127f..26896d5 100644 --- a/src/components/table_filter.rs +++ b/src/components/table_filter.rs @@ -193,7 +193,7 @@ impl Component for TableFilterComponent { fn event(&mut self, key: Key) -> Result { let input_str: String = self.input.iter().collect(); - // apply comletion candidates + // apply completion candidates if key == self.key_config.enter { return self.complete(); } From 720b619343ae5fb6ddd1e159de0d3fb8b4662004 Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:38:20 +0900 Subject: [PATCH 3/5] add a github action for typos --- .github/workflows/typos.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/typos.yml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 0000000..8ab4a08 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,13 @@ +name: GitHub Action +on: [pull_request] + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + + - name: Run Typos + uses: crate-ci/typos@master From cd64a123e034c418903c6993accd48887d35f160 Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:14:15 +0900 Subject: [PATCH 4/5] name change --- .github/workflows/typos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 8ab4a08..1d3888c 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -1,9 +1,9 @@ -name: GitHub Action +name: Typos on: [pull_request] jobs: run: - name: Spell Check with Typos + name: Spell Check runs-on: ubuntu-latest steps: - name: Checkout Actions Repository From d50239ca0b5a5f11742fbe67de6758c280987653 Mon Sep 17 00:00:00 2001 From: kyoto7250 <50972773+kyoto7250@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:20:18 +0900 Subject: [PATCH 5/5] fix test --- .typos.toml | 1 + src/components/databases.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.typos.toml b/.typos.toml index 502d82b..38c7ba6 100644 --- a/.typos.toml +++ b/.typos.toml @@ -5,6 +5,7 @@ syntact = "syntact" zhobo = "zhobo" ratatui = "ratatui" +ba = "ba" # src/components/databases.rs [type.md] diff --git a/src/components/databases.rs b/src/components/databases.rs index b659670..8d9516a 100644 --- a/src/components/databases.rs +++ b/src/components/databases.rs @@ -397,7 +397,7 @@ mod test { Some("rb".to_string()), ), Line::from(vec![ - Span::raw(format!(" {}", "by")), + Span::raw(format!(" {}", "ba")), Span::styled("rb", Style::default().fg(Color::Blue)), Span::raw(format!("{:w$}", "az", w = WIDTH as usize)) ]) @@ -423,7 +423,7 @@ mod test { Some("rb".to_string()), ), Line::from(vec![ - Span::styled(format!(" {}", "by"), Style::default().bg(Color::Blue)), + Span::styled(format!(" {}", "ba"), Style::default().bg(Color::Blue)), Span::styled("rb", Style::default().bg(Color::Blue).fg(Color::Blue)), Span::styled( format!("{:w$}", "az", w = WIDTH as usize),