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

chore(lib): fully refactor the library for v3 #117

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

chore(lib): fully refactor the library for v3 #117

wants to merge 8 commits into from

Conversation

jeertmans
Copy link
Owner

@jeertmans jeertmans commented Apr 19, 2024

The goal of this PR is to reorganize the crate so that:

  • LanguageTool API related stuff is self-contained in src/lib/. This folder should not contain anything else, except a few mandatory CLI related features, guarded behind #[cfg_attr(feature = "cli", derive(...))] and similar;
  • put WordsAdd and WordsDelete inside submodules;
  • put CLI related stuff inside src/cli, and renamed cli.rs to src/lib/mod.rs;
  • in src/cli/check.rs, prepare the necessary logic to (1) read multiple filenames, (2) detect file type and use correct parser (i.e., Typst, Markdown, or raw text), and (3) generate a many requests as needed, splitting long text if needed.
  • some work may be needed to join multiple requests that were generated using data annotation, as Typst and Markdown parser will eventually generate annotated data
  • Error::ResponseEncode and Error::RequestEncode are remove and only Error::Request is used.
  • A bit unrelated, but we can edit
    tag: [latest, '5.5', '5.6', '5.7', '5.8', '5.9', '6.0', '6.1']
    so that it also covers 6.2, 6.3, 6.4, and 6.5

@jeertmans jeertmans added the library Relate to the library (i.e., crate) label Apr 19, 2024

This comment was marked as outdated.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

LanguageTool

src/check.rs|861 col 4| If ‘Type’ is a classification term, ‘a’ is not necessary. Use “Type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.) (KIND_OF_A[1])
Suggestions: Type of
Rule: https://community.languagetool.org/rule/show/KIND_OF_A?lang=en-US&subId=1
Category: GRAMMAR
src/check.rs|884 col 38| Possible agreement error - use third-person verb forms for singular and mass nouns. (MASS_AGREEMENT[11])
Suggestions: starts
Rule: https://community.languagetool.org/rule/show/MASS_AGREEMENT?lang=en-US&subId=11
Category: GRAMMAR
src/check.rs|993 col 20| This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING
src/check.rs|1017 col 20| Two consecutive dots (DOUBLE_PUNCTUATION)
Suggestions: .,
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-periods
Rule: https://community.languagetool.org/rule/show/DOUBLE_PUNCTUATION?lang=en-US
Category: PUNCTUATION
src/check.rs|1121 col 13| If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Response, response
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING
src/check.rs|1174 col 18| Two consecutive dots (DOUBLE_PUNCTUATION)
Suggestions: .,
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-periods
Rule: https://community.languagetool.org/rule/show/DOUBLE_PUNCTUATION?lang=en-US
Category: PUNCTUATION
src/check.rs|1189 col 13| If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Offset, offset
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

CHANGELOG.md Outdated Show resolved Hide resolved
src/api/check.rs Show resolved Hide resolved
src/api/mod.rs Outdated Show resolved Hide resolved
src/api/mod.rs Outdated Show resolved Hide resolved
src/api/mod.rs Outdated Show resolved Hide resolved
src/check.rs Outdated Show resolved Hide resolved
src/check.rs Outdated Show resolved Hide resolved
src/check.rs Outdated Show resolved Hide resolved
src/check.rs Outdated Show resolved Hide resolved
src/check.rs Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

LanguageTool

[LanguageTool] reported by reviewdog 🐶
A comma may be missing after the conjunctive/linking adverb ‘Thus’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA[1])
Suggestions: Thus,
URL: https://languagetool.org/insights/post/linking-words/
Rule: https://community.languagetool.org/rule/show/SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA?lang=en-US&subId=1
Category: PUNCTUATION

/// used. Thus this parameter can be used to specify the preferred variants


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Text, text
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.text = Some(text);


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Data, data
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.data = None;


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Data, data
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.data = Some(data);


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Text, text
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.text = None;


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Language, language
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.language = language;


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Text, text
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

if let Some(ref text) = self.text {


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Data, data
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

} else if let Some(ref data) = self.data {


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Text, text
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

if let Some(ref t) = da.text {


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Markup, markup
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

} else if let Some(ref t) = da.markup {


[LanguageTool] reported by reviewdog 🐶
Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
Suggestions: text
Rule: https://community.languagetool.org/rule/show/ENGLISH_WORD_REPEAT_RULE?lang=en-US
Category: MISC

/// - raw text, if `--text TEXT` is provided;


[LanguageTool] reported by reviewdog 🐶
This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING

/// Category id.


[LanguageTool] reported by reviewdog 🐶
This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING

pub id: String,


[LanguageTool] reported by reviewdog 🐶
This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING

/// Rule id.


[LanguageTool] reported by reviewdog 🐶
This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING

pub id: String,


[LanguageTool] reported by reviewdog 🐶
This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING

/// Rule sub id.


[LanguageTool] reported by reviewdog 🐶
If ‘Type’ is a classification term, ‘a’ is not necessary. Use “Type of”. (The phrases ‘kind of’ and ‘sort of’ are informal if they mean ‘to some extent’.) (KIND_OF_A[1])
Suggestions: Type of
Rule: https://community.languagetool.org/rule/show/KIND_OF_A?lang=en-US&subId=1
Category: GRAMMAR

/// Type of a given match.


[LanguageTool] reported by reviewdog 🐶
Possible agreement error - use third-person verb forms for singular and mass nouns. (MASS_AGREEMENT[11])
Suggestions: starts
Rule: https://community.languagetool.org/rule/show/MASS_AGREEMENT?lang=en-US&subId=11
Category: GRAMMAR

/// Char index at which the match start.


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub fn iter_matches(&self) -> std::slice::Iter<'_, Match> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub fn iter_matches_mut(&mut self) -> std::slice::IterMut<'_, Match> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

acc.push_str(", ");


[LanguageTool] reported by reviewdog 🐶
This abbreviation for “identification” is spelled all-uppercase. (ID_CASING[2])
Suggestions: ID
Rule: https://community.languagetool.org/rule/show/ID_CASING?lang=en-US&subId=2
Category: CASING

id: Some(&m.rule.id),


[LanguageTool] reported by reviewdog 🐶
Two consecutive dots (DOUBLE_PUNCTUATION)
Suggestions: .,
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-periods
Rule: https://community.languagetool.org/rule/show/DOUBLE_PUNCTUATION?lang=en-US
Category: PUNCTUATION

..Default::default()


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

annotation.push('\n');


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub fn iter_matches(&self) -> std::slice::Iter<'_, Match> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub fn iter_matches_mut(&mut self) -> std::slice::IterMut<'_, Match> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub fn iter_match_positions(&self) -> MatchPositions<'_, std::slice::Iter<'_, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub fn iter_match_positions(&self) -> MatchPositions<'_, std::slice::Iter<'_, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

let iter: MatchPositions<'_, std::slice::IterMut<'_, Match>> = (&mut resp).into();


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

let iter: MatchPositions<'_, std::slice::IterMut<'_, Match>> = (&mut resp).into();


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Response, response
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

resp.response


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub struct MatchPositions<'source, T> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

text_chars: std::str::Chars<'source>,


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::Iter<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::Iter<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(response: &'source ResponseWithContext) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source mut ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source mut ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::IterMut<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::IterMut<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(response: &'source mut ResponseWithContext) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source, T> MatchPositions<'source, T> {


[LanguageTool] reported by reviewdog 🐶
Two consecutive dots (DOUBLE_PUNCTUATION)
Suggestions: .,
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-periods
Rule: https://community.languagetool.org/rule/show/DOUBLE_PUNCTUATION?lang=en-US
Category: PUNCTUATION

for _ in 0..n {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

Some('\n') => {


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Offset, offset
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.offset = m.offset;


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::Iter<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::Iter<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::Iter<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

type Item = (usize, usize, &'source Match);


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::IterMut<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::IterMut<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::IterMut<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

type Item = (usize, usize, &'source mut Match);


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

enum Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

Text(&'source str),


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

Skip(&'source str),


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(s: &'source str) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<Token<'source>> for DataAnnotation {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<Token<'source>> for DataAnnotation {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

let words: Vec<&str> = "My name is Q34XY".split(' ').collect();


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

#![doc = include_str!("../README.md")]


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

#![doc = include_str!("../README.md")]

src/api/check.rs Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

LanguageTool

[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Response, response
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

resp.response


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

pub struct MatchPositions<'source, T> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

text_chars: std::str::Chars<'source>,


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::Iter<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::Iter<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(response: &'source ResponseWithContext) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source mut ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source mut ResponseWithContext>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::IterMut<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

for MatchPositions<'source, std::slice::IterMut<'source, Match>>


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(response: &'source mut ResponseWithContext) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source, T> MatchPositions<'source, T> {


[LanguageTool] reported by reviewdog 🐶
Two consecutive dots (DOUBLE_PUNCTUATION)
Suggestions: .,
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-periods
Rule: https://community.languagetool.org/rule/show/DOUBLE_PUNCTUATION?lang=en-US
Category: PUNCTUATION

for _ in 0..n {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

Some('\n') => {


[LanguageTool] reported by reviewdog 🐶
If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD[1])
Suggestions: Offset, offset
Rule: https://community.languagetool.org/rule/show/LC_AFTER_PERIOD?lang=en-US&subId=1
Category: CASING

self.offset = m.offset;


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::Iter<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::Iter<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::Iter<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

type Item = (usize, usize, &'source Match);


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::IterMut<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::IterMut<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> Iterator for MatchPositions<'source, std::slice::IterMut<'source, Match>> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

type Item = (usize, usize, &'source mut Match);


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

enum Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

Text(&'source str),


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

Skip(&'source str),


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(s: &'source str) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<Token<'source>> for DataAnnotation {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<Token<'source>> for DataAnnotation {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

let words: Vec<&str> = "My name is Q34XY".split(' ').collect();


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

#![doc = include_str!("../README.md")]


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

#![doc = include_str!("../README.md")]

@jeertmans jeertmans added enhancement New feature or request cli Related to the CLI labels Sep 19, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

LanguageTool

[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<&'source str> for Token<'source> {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

fn from(s: &'source str) -> Self {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<Token<'source>> for DataAnnotation {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

impl<'source> From<Token<'source>> for DataAnnotation {


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘'’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

let words: Vec<&str> = "My name is Q34XY".split(' ').collect();


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

#![doc = include_str!("../README.md")]


[LanguageTool] reported by reviewdog 🐶
Unpaired symbol: ‘"’ seems to be missing (EN_UNPAIRED_QUOTES)
URL: https://languagetool.org/insights/post/punctuation-guide/#what-are-parentheses
Rule: https://community.languagetool.org/rule/show/EN_UNPAIRED_QUOTES?lang=en-US
Category: PUNCTUATION

#![doc = include_str!("../README.md")]

jeertmans added a commit that referenced this pull request Sep 28, 2024
* fix!: adjustments after refactor

* Update README.md

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>

* docs(changelog): remove mention of support for markdown and typst files for now

* refactor: use `check::Request`, `check::Response` and `check::ResponseWithContext`

* chore: formatting

* fix: minimum Rust version needs to be higher for `clap`

* fix: doc test

* refactor: use crate's result type for the `check` method on `Client`

* refactor: use crate's result type for the `languages` method on `Client`

* Update src/api/mod.rs

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>

* Update src/api/mod.rs

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>

* fix: convert `reqwest` error

---------

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
src/api/check.rs Show resolved Hide resolved
src/api/check.rs Show resolved Hide resolved
src/api/check.rs Show resolved Hide resolved
src/api/check.rs Show resolved Hide resolved
src/api/check.rs Show resolved Hide resolved
src/api/mod.rs Show resolved Hide resolved
src/api/mod.rs Show resolved Hide resolved
src/api/mod.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved

This comment was marked as outdated.

jeertmans and others added 5 commits September 29, 2024 10:12
* fix!: adjustments after refactor

* Update README.md

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>

* docs(changelog): remove mention of support for markdown and typst files for now

* refactor: use `check::Request`, `check::Response` and `check::ResponseWithContext`

* chore: formatting

* fix: minimum Rust version needs to be higher for `clap`

* fix: doc test

* refactor: use crate's result type for the `check` method on `Client`

* refactor: use crate's result type for the `languages` method on `Client`

* Update src/api/mod.rs

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>

* Update src/api/mod.rs

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>

* fix: convert `reqwest` error

---------

Co-authored-by: Jérome Eertmans <jeertmans@icloud.com>
Copy link

codspeed-hq bot commented Sep 29, 2024

CodSpeed Performance Report

Congrats! CodSpeed is installed 🎉

🆕 6 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks

  • large (109.1 ms)
  • medium (109 ms)
  • small (108.5 ms)
  • large (126.6 ms)
  • medium (112.8 ms)
  • small (109.3 ms)

Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 28 lines in your changes missing coverage. Please review.

Project coverage is 22.93%. Comparing base (eff21fc) to head (a7247e4).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/api/server.rs 26.66% 11 Missing ⚠️
src/api/mod.rs 0.00% 10 Missing ⚠️
src/api/check.rs 50.00% 3 Missing ⚠️
src/api/words/mod.rs 0.00% 3 Missing ⚠️
src/cli.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #117      +/-   ##
==========================================
- Coverage   23.55%   22.93%   -0.62%     
==========================================
  Files           7        8       +1     
  Lines         518      532      +14     
==========================================
  Hits          122      122              
- Misses        396      410      +14     
Flag Coverage Δ
22.93% <20.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jeertmans
Copy link
Owner Author

Hi @Rolv-Apneseth! So I just did some efforts to clean the CI, and also slightly updated the main comment of this PR. What would you like to work on? I don't have much time to actually implement things, as I have other work to do for my thesis ^^', but I am happy to perform reviews :-)

@Rolv-Apneseth
Copy link

Hi! I don't mind, what do you think is a reasonable next step here? Also best of luck with your thesis

@jeertmans
Copy link
Owner Author

Hi! I don't mind, what do you think is a reasonable next step here? Also best of luck with your thesis

Thanks! Can you just check the to-do list above, and see what you can do?

@Rolv-Apneseth
Copy link

Sure, so maybe for the first one I can just move all API code to a src/lib/ directory, and move cli stuff to src/cli/mod.rs? WordsAdd and WordsDelete should already be in submodules.

Also would you mind explaining the reasoning behind the cli feature? I thought that would just be separated out entirely and only used in main.rs

@jeertmans
Copy link
Owner Author

Sure, so maybe for the first one I can just move all API code to a src/lib/ directory, and move cli stuff to src/cli/mod.rs? WordsAdd and WordsDelete should already be in submodules.

Sure, looks good!

Also would you mind explaining the reasoning behind the cli feature? I thought that would just be separated out entirely and only used in main.rs

Of course :-)
Two main reasons:

  1. People may want to use LTRS as a crate, and I don't want to enforce them to download and compile the code that is only used for building the CLI. Using a feature allows excluding this part of the library.
  2. I don't want to pollute the "language tool API binding" parts with too much code that is not related to it. The only exceptions are the derive macros that are way more convenient to put directly on the original request structures.

Did I answer your question?

@Rolv-Apneseth
Copy link

Not quite sorry. I understand being able to disable it, but what is the benefit of enabling it? Why not just have the CLI stuff separated entirely from the library side, and only used in the binary

@jeertmans
Copy link
Owner Author

Not quite sorry. I understand being able to disable it, but what is the benefit of enabling it? Why not just have the CLI stuff separated entirely from the library side, and only used in the binary

There is too much things to be put inside just main.rs

Creating a sub crate allows to have a cleaner workspace, and testing libraries is also easier. Finally, people could be interested to have the CLI tools exposed in the public API, e.g., to create a wrapper application. There may be better project organization, and I am of course open to suggestion.

@Rolv-Apneseth
Copy link

people could be interested to have the CLI tools exposed in the public API, e.g., to create a wrapper application.

I see, alright that makes sense, thank you

@Rolv-Apneseth
Copy link

Perhaps we could split it into a separate workspace with a library of it's own? It would need to be published as a separate crate though I guess. Anyway, not necessary, just a possibility.

@Rolv-Apneseth
Copy link

I'm actually not sure how to split it up as it is, could you advise a bit on how to proceed? The CLI and rest of the API functionality are very heavily intertwined and I need lib.rs where it is so that it can import api.

Only easy change I can see would be moving docker.rs and api.rs into an api directory, as it appears to me like everything for docker depends on the cli feature anyway? I could use some clarification on that one - is it only meant to be used via the library? It could be nice to have a docker subcommand for the CLI if that code is works as intended.

I personally think it's fine how it is currently if you want to keep the setup with the cli feature. I would consider removing the feature altogether though as it's unlikely to be useful to others in my opinion, as they can just use the library to achieve the primary functionality of this project, or call the binary and read it's output if they do need some kind of wrapper.

@jeertmans
Copy link
Owner Author

Hey @Rolv-Apneseth, sorry for the late reply!

For the multiple crate workspace, this is indeed a solution, but it also requires some additional work for (1) publishing crates and (2) potentially exposing more things to the public API so they can be used in the "cli" crate. All that being said, splitting the work in separate crates is not urgent, not to say the hassle, I think.

So, I prefer to stick with the current layout:

lib.rs  <-- this exports modules as public, even the `mod cli` that is exported behind the `cli` feature
main.rs <-- this imports the main Clap command and runs it
error.rs  <-- this defines error types used all across the crate
api/
  mod.rs
  check.rs <-- I think it would be better to allow string references, not `String`, or a least Cow<'str>, because we may want to have dumb copies, especially when serializing requests already performs a copy, so we never need owned data
  word.rs
  langages.rs
  docker.rs
  server.rs  <-- we might want to remove the logic for splitting requests, and only put it in CLI, not sure (I want the server to be dead simple, but still provide a way for efficient multiple requests). I am open to any suggestion.
cli/
  mod.rs <-- this creates the main Clap command, that is simply imported and executed in main.rs
  check.rs <-- this, e.g., should handle arguments like files, stdin, 'raw' and produce appropriate requests (e.g., one request for file). Usually, you create a Clap command that flattens `api::check::Request`.
  words.rs <-- should be dead simple
  languages <-- should be dead simple
  ...

E.g., cli/docker.rs would import everything needed from lib/docker.rs and create the DockerCommand, see https://github.com/jeertmans/languagetool-rust/blob/a217b4061f35a915920514ba73a55720f3fdff29/src/lib/docker.rs#L154C1-L173C2

This command is then imported in cli/mod.rs to build the full CLI.

I know it may not be 100% clear, especially as it isn't still crystal clear to me what I would prefer doing, but I hope the small "directory tree" explanation helped. Let me know what you think and let's start to take decisions :-)

@Rolv-Apneseth
Copy link

Hey, all good.

So, I prefer to stick with the current layout

Sure, makes sense.

we might want to remove the logic for splitting requests, and only put it in CLI, not sure (I want the server to be dead simple, but still provide a way for efficient multiple requests). I am open to any suggestion

I'm don't know what's best, but probably OK to keep it in with the server logic?

As for the other things - I believe I have a better idea of what the goal is now. I'll make a PR hopefully today and you can request whatever changes you want, so we can get into the specifics

@jeertmans
Copy link
Owner Author

Hey, all good.

So, I prefer to stick with the current layout

Sure, makes sense.

we might want to remove the logic for splitting requests, and only put it in CLI, not sure (I want the server to be dead simple, but still provide a way for efficient multiple requests). I am open to any suggestion

I'm don't know what's best, but probably OK to keep it in with the server logic?

As for the other things - I believe I have a better idea of what the goal is now. I'll make a PR hopefully today and you can request whatever changes you want, so we can get into the specifics

Great! Please suggest anything :-) I am currently a bit overwhelmed with work on my thesis, it's hard for my to give this project more than a few hours a week, which also means I didn't have yet enough time to pause and think about how to clearly plan the next steps.

So go on and work on whatever part you prefer about this PR, I will try to review them relatively quickly, and I hope to give more time to this project after my deadlines (i.e., end of October).

@Rolv-Apneseth
Copy link

Yeah no worries, there's no rush with any of this anyway. I'm working on some refactoring now, we'll see if I finish today or tomorrow but either way you can review and make suggestions just whenever you get the chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the CLI enhancement New feature or request library Relate to the library (i.e., crate)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants