From e7a73c1b4246c2062182456ab79078b5376204d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 23 Jun 2025 23:20:49 +0300 Subject: [PATCH] style: spelling and grammar fixes --- deployment/schema.json | 2 +- src/configuration/types.rs | 4 ++-- src/format_text.rs | 2 +- src/generation/cmark/parsing/parse_image.rs | 2 +- src/generation/common/ast_nodes.rs | 2 +- src/generation/generate.rs | 6 +++--- tests/specs/Text/Text_TextWrap_Always.txt | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/deployment/schema.json b/deployment/schema.json index fdf6c2e..408f818 100644 --- a/deployment/schema.json +++ b/deployment/schema.json @@ -87,7 +87,7 @@ }, "properties": { "locked": { - "description": "Whether the configuration is not allowed to be overriden or extended.", + "description": "Whether the configuration is not allowed to be overridden or extended.", "type": "boolean" }, "lineWidth": { diff --git a/src/configuration/types.rs b/src/configuration/types.rs index 76d1afe..13c0bcb 100644 --- a/src/configuration/types.rs +++ b/src/configuration/types.rs @@ -69,11 +69,11 @@ generate_str_to_from![StrongKind, [Asterisks, "asterisks"], [Underscores, "under pub enum UnorderedListKind { /// Uses dashes (-) as primary character for lists (default). /// - /// In this case, asterisks are used as alternate list chracters. + /// In this case, asterisks are used as alternate list characters. Dashes, /// Uses asterisks (*) as primary character for lists. /// - /// In this case, dashes are used as alternate list chracters. + /// In this case, dashes are used as alternate list characters. Asterisks, } diff --git a/src/format_text.rs b/src/format_text.rs index d2db17b..2c5e2d8 100644 --- a/src/format_text.rs +++ b/src/format_text.rs @@ -81,7 +81,7 @@ enum ParseFileResult<'a> { } fn parse_source_file<'a>(file_text: &'a str, config: &Configuration) -> Result> { - // check for the presence of an dprint-ignore-file comment before parsing + // check for the presence of a dprint-ignore-file comment before parsing if file_has_ignore_file_directive(strip_metadata_header(file_text), &config.ignore_file_directive) { return Ok(ParseFileResult::IgnoreFile); } diff --git a/src/generation/cmark/parsing/parse_image.rs b/src/generation/cmark/parsing/parse_image.rs index 0440e21..d9a15a1 100644 --- a/src/generation/cmark/parsing/parse_image.rs +++ b/src/generation/cmark/parsing/parse_image.rs @@ -4,7 +4,7 @@ use super::parse_text_in_parens; use crate::generation::common::*; use pulldown_cmark::LinkType; -/// Crudely parses out an image assuming the text is a image. +/// Crudely parses out an image assuming the text is an image. /// This is done because images have their references inlined by cmark. pub fn parse_image(offset: usize, text: &str, link_type: LinkType) -> Result { let mut char_scanner = CharScanner::new(offset, text); diff --git a/src/generation/common/ast_nodes.rs b/src/generation/common/ast_nodes.rs index ecc84eb..c0591ac 100644 --- a/src/generation/common/ast_nodes.rs +++ b/src/generation/common/ast_nodes.rs @@ -279,7 +279,7 @@ impl Node { } } - pub fn has_preceeding_space(&self, file_text: &str) -> bool { + pub fn has_preceding_space(&self, file_text: &str) -> bool { let range = self.range(); if range.start == 0 { false diff --git a/src/generation/generate.rs b/src/generation/generate.rs index 173b72c..227fe4b 100644 --- a/src/generation/generate.rs +++ b/src/generation/generate.rs @@ -162,15 +162,15 @@ fn gen_nodes(nodes: &[Node], context: &mut Context) -> PrintItems { items.push_signal(Signal::NewLine); } else { let needs_space = if let Node::Html(_) = last_node { - node.has_preceeding_space(context.file_text) + node.has_preceding_space(context.file_text) } else if matches!(last_node, Node::Text(_)) || matches!(node, Node::Text(_)) { - node.has_preceeding_space(context.file_text) + node.has_preceding_space(context.file_text) || !last_node.ends_with_punctuation(context.file_text) && !node.starts_with_punctuation(context.file_text) } else if let Node::FootnoteReference(_) = node { false } else if let Node::Html(_) = node { - node.has_preceeding_space(context.file_text) + node.has_preceding_space(context.file_text) } else { true }; diff --git a/tests/specs/Text/Text_TextWrap_Always.txt b/tests/specs/Text/Text_TextWrap_Always.txt index 177c189..4d565a6 100644 --- a/tests/specs/Text/Text_TextWrap_Always.txt +++ b/tests/specs/Text/Text_TextWrap_Always.txt @@ -34,14 +34,14 @@ testing this out with some text thatt 40) testing this out with some text thatt 40) -!! should not wrap a number with a dot on the end to the next line when preceeded by another node !! +!! should not wrap a number with a dot on the end to the next line when preceded by another node !! testing this out with some text `tht` 40. [expect] testing this out with some text `tht` 40. -!! should not wrap a number with a paren on the end to the next line when preceeded by another node !! +!! should not wrap a number with a paren on the end to the next line when preceded by another node !! testing this out with some text `tht` 40) [expect]