Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check typos in CI #557

Merged
merged 1 commit into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Typos
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3

- name: Check spelling
uses: crate-ci/typos@master
6 changes: 6 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[files]
extend-exclude = ["src/core_editor/line_buffer.rs"]

[default.extend-words]
# Ignore false-positives
iterm = "iterm"
2 changes: 1 addition & 1 deletion src/completion/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct Suggestion {
/// Optional description for the replacement
pub description: Option<String>,
/// Optional vector of strings in the suggestion. These can be used to
/// represent examples comming from a suggestion
/// represent examples coming from a suggestion
pub extra: Option<Vec<String>>,
/// Replacement span in the buffer
pub span: Span,
Expand Down
6 changes: 3 additions & 3 deletions src/completion/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ impl Completer for DefaultCompleter {
let mut span_line_whitespaces = 0;
let mut completions = vec![];
if !line.is_empty() {
let mut splitted = line[0..pos].split(' ').rev();
let mut split = line[0..pos].split(' ').rev();
let mut span_line: String = String::new();
for _ in 0..splitted.clone().count() {
if let Some(s) = splitted.next() {
for _ in 0..split.clone().count() {
if let Some(s) = split.next() {
if s.is_empty() {
span_line_whitespaces += 1;
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/core_editor/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ mod test {
}

#[test]
fn test_undo_insert_works_on_work_boundries() {
fn test_undo_insert_works_on_work_boundaries() {
let mut editor = editor_with("This is a");
for cmd in str_to_edit_commands(" test") {
editor.run_edit_command(&cmd);
Expand Down
4 changes: 2 additions & 2 deletions src/core_editor/line_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl LineBuffer {

/// Sets the current edit position
/// ## Unicode safety:
/// Not checked, inproper use may cause panics in following operations
/// Not checked, improper use may cause panics in following operations
pub fn set_insertion_point(&mut self, offset: usize) {
self.insertion_point = offset;
}
Expand Down Expand Up @@ -998,7 +998,7 @@ mod test {

#[rstest]
#[case("This is a test", 13, "This is a tets", 14)]
#[case("This is a test", 14, "This is a tets", 14)] // NOTE: Swaping works in opposite direction at last index
#[case("This is a test", 14, "This is a tets", 14)] // NOTE: Swapping works in opposite direction at last index
#[case("This is a test", 4, "Thi sis a test", 5)] // NOTE: Swaps space, moves right
#[case("This is a test", 0, "hTis is a test", 2)]
fn swap_graphemes_work(
Expand Down
2 changes: 1 addition & 1 deletion src/edit_mode/keybindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Keybindings {
///
/// # Panics
///
/// If `comamnd` is an empty [`ReedlineEvent::UntilFound`]
/// If `command` is an empty [`ReedlineEvent::UntilFound`]
pub fn add_binding(
&mut self,
modifier: KeyModifiers,
Expand Down