mirror of
https://github.com/nushell/reedline.git
synced 2024-09-11 15:55:50 +03:00
Check typos in CI (#557)
This commit is contained in:
parent
af7b447a06
commit
f75afbdeba
13
.github/workflows/typos.yml
vendored
Normal file
13
.github/workflows/typos.yml
vendored
Normal file
@ -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
.typos.toml
Normal file
6
.typos.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[files]
|
||||||
|
extend-exclude = ["src/core_editor/line_buffer.rs"]
|
||||||
|
|
||||||
|
[default.extend-words]
|
||||||
|
# Ignore false-positives
|
||||||
|
iterm = "iterm"
|
@ -61,7 +61,7 @@ pub struct Suggestion {
|
|||||||
/// Optional description for the replacement
|
/// Optional description for the replacement
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
/// Optional vector of strings in the suggestion. These can be used to
|
/// 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>>,
|
pub extra: Option<Vec<String>>,
|
||||||
/// Replacement span in the buffer
|
/// Replacement span in the buffer
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
@ -72,10 +72,10 @@ impl Completer for DefaultCompleter {
|
|||||||
let mut span_line_whitespaces = 0;
|
let mut span_line_whitespaces = 0;
|
||||||
let mut completions = vec![];
|
let mut completions = vec![];
|
||||||
if !line.is_empty() {
|
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();
|
let mut span_line: String = String::new();
|
||||||
for _ in 0..splitted.clone().count() {
|
for _ in 0..split.clone().count() {
|
||||||
if let Some(s) = splitted.next() {
|
if let Some(s) = split.next() {
|
||||||
if s.is_empty() {
|
if s.is_empty() {
|
||||||
span_line_whitespaces += 1;
|
span_line_whitespaces += 1;
|
||||||
continue;
|
continue;
|
||||||
|
@ -556,7 +556,7 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[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");
|
let mut editor = editor_with("This is a");
|
||||||
for cmd in str_to_edit_commands(" test") {
|
for cmd in str_to_edit_commands(" test") {
|
||||||
editor.run_edit_command(&cmd);
|
editor.run_edit_command(&cmd);
|
||||||
|
@ -67,7 +67,7 @@ impl LineBuffer {
|
|||||||
|
|
||||||
/// Sets the current edit position
|
/// Sets the current edit position
|
||||||
/// ## Unicode safety:
|
/// ## 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) {
|
pub fn set_insertion_point(&mut self, offset: usize) {
|
||||||
self.insertion_point = offset;
|
self.insertion_point = offset;
|
||||||
}
|
}
|
||||||
@ -998,7 +998,7 @@ mod test {
|
|||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
#[case("This is a test", 13, "This is a tets", 14)]
|
#[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", 4, "Thi sis a test", 5)] // NOTE: Swaps space, moves right
|
||||||
#[case("This is a test", 0, "hTis is a test", 2)]
|
#[case("This is a test", 0, "hTis is a test", 2)]
|
||||||
fn swap_graphemes_work(
|
fn swap_graphemes_work(
|
||||||
|
@ -41,7 +41,7 @@ impl Keybindings {
|
|||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// If `comamnd` is an empty [`ReedlineEvent::UntilFound`]
|
/// If `command` is an empty [`ReedlineEvent::UntilFound`]
|
||||||
pub fn add_binding(
|
pub fn add_binding(
|
||||||
&mut self,
|
&mut self,
|
||||||
modifier: KeyModifiers,
|
modifier: KeyModifiers,
|
||||||
|
Loading…
Reference in New Issue
Block a user