Skip to content
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
3 changes: 2 additions & 1 deletion harper-core/src/linting/after_later.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ impl ExprLinter for AfterLater {

#[cfg(test)]
mod tests {
use crate::linting::{AfterLater, tests::assert_top3_suggestion_result};
use super::AfterLater;
use crate::linting::tests::assert_top3_suggestion_result;

#[test]
fn after_90_days_later() {
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/allow_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ impl ExprLinter for AllowTo {

#[cfg(test)]
mod tests {
use crate::linting::{
AllowTo,
tests::{assert_lint_count, assert_no_lints},
};
use super::AllowTo;
use crate::linting::tests::{assert_lint_count, assert_no_lints};

#[test]
fn flag_allow_to() {
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/and_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ impl ExprLinter for AndIn {

#[cfg(test)]
mod tests {
use crate::linting::{
AndIn,
tests::{assert_no_lints, assert_suggestion_result},
};
use super::AndIn;
use crate::linting::tests::{assert_no_lints, assert_suggestion_result};

#[test]
fn dont_flag_an_in_house() {
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/cautionary_tale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ impl ExprLinter for CautionaryTale {

#[cfg(test)]
mod tests {
use crate::linting::{
CautionaryTale,
tests::{assert_lint_count, assert_suggestion_result},
};
use super::CautionaryTale;
use crate::linting::tests::{assert_lint_count, assert_suggestion_result};

#[test]
fn catches_cautionary_tail() {
Expand Down
3 changes: 2 additions & 1 deletion harper-core/src/linting/change_tack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ impl ExprLinter for ChangeTack {

#[cfg(test)]
mod tests {
use crate::linting::{ChangeTack, tests::assert_suggestion_result};
use super::ChangeTack;
use crate::linting::tests::assert_suggestion_result;

// Verbs: change tack

Expand Down
6 changes: 3 additions & 3 deletions harper-core/src/linting/far_be_it.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ impl ExprLinter for FarBeIt {

#[cfg(test)]
mod tests {
use crate::linting::{
FarBeIt,
tests::{assert_no_lints, assert_suggestion_count, assert_suggestion_result},
use super::FarBeIt;
use crate::linting::tests::{
assert_no_lints, assert_suggestion_count, assert_suggestion_result,
};

#[test]
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/go_so_far_as_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ impl ExprLinter for GoSoFarAsTo {

#[cfg(test)]
mod tests {
use crate::linting::{
GoSoFarAsTo,
tests::{assert_no_lints, assert_suggestion_result},
};
use super::GoSoFarAsTo;
use crate::linting::tests::{assert_no_lints, assert_suggestion_result};

#[test]
fn go_so_far_to() {
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/have_take_a_look.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ impl ExprLinter for HaveTakeALook {

#[cfg(test)]
mod tests {
use crate::{
Dialect,
linting::{HaveTakeALook, tests::assert_suggestion_result},
};
use super::HaveTakeALook;
use crate::{Dialect, linting::tests::assert_suggestion_result};

#[test]
fn correct_taking_a_look() {
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/in_on_the_cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ impl ExprLinter for InOnTheCards {

#[cfg(test)]
mod tests {
use super::InOnTheCards;
use crate::{
Dialect,
linting::{
InOnTheCards,
tests::{assert_lint_count, assert_suggestion_result},
},
linting::tests::{assert_lint_count, assert_suggestion_result},
};

// On the cards
Expand Down
12 changes: 7 additions & 5 deletions harper-core/src/linting/lint_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use super::compound_subject_i::CompoundSubjectI;
use super::confident::Confident;
use super::correct_number_suffix::CorrectNumberSuffix;
use super::criteria_phenomena::CriteriaPhenomena;
use super::currency_placement::CurrencyPlacement;
use super::despite_of::DespiteOf;
use super::didnt::Didnt;
use super::discourse_markers::DiscourseMarkers;
Expand Down Expand Up @@ -88,6 +89,7 @@ use super::lets_confusion::LetsConfusion;
use super::likewise::Likewise;
use super::long_sentences::LongSentences;
use super::looking_forward_to::LookingForwardTo;
use super::mass_plurals::MassPlurals;
use super::merge_words::MergeWords;
use super::missing_preposition::MissingPreposition;
use super::missing_to::MissingTo;
Expand All @@ -104,9 +106,11 @@ use super::nail_on_the_head::NailOnTheHead;
use super::need_to_noun::NeedToNoun;
use super::no_french_spaces::NoFrenchSpaces;
use super::no_match_for::NoMatchFor;
use super::no_oxford_comma::NoOxfordComma;
use super::nobody::Nobody;
use super::nominal_wants::NominalWants;
use super::noun_countability::NounCountability;
use super::noun_verb_confusion::NounVerbConfusion;
use super::number_suffix_capitalization::NumberSuffixCapitalization;
use super::of_course::OfCourse;
use super::on_floor::OnFloor;
Expand All @@ -116,6 +120,7 @@ use super::open_the_light::OpenTheLight;
use super::orthographic_consistency::OrthographicConsistency;
use super::ought_to_be::OughtToBe;
use super::out_of_date::OutOfDate;
use super::oxford_comma::OxfordComma;
use super::oxymorons::Oxymorons;
use super::phrasal_verb_as_compound_noun::PhrasalVerbAsCompoundNoun;
use super::pique_interest::PiqueInterest;
Expand Down Expand Up @@ -179,14 +184,11 @@ use super::widely_accepted::WidelyAccepted;
use super::win_prize::WinPrize;
use super::wordpress_dotcom::WordPressDotcom;
use super::would_never_have::WouldNeverHave;
use super::{CurrencyPlacement, HtmlDescriptionLinter, Linter, NoOxfordComma, OxfordComma};
use super::{ExprLinter, Lint};
use super::{HtmlDescriptionLinter, Linter};
use crate::linting::dashes::Dashes;
use crate::linting::open_compounds::OpenCompounds;
use crate::linting::{
MassPlurals, NounVerbConfusion, closed_compounds, initialisms, phrase_corrections,
phrase_set_corrections,
};
use crate::linting::{closed_compounds, initialisms, phrase_corrections, phrase_set_corrections};
use crate::spell::{Dictionary, MutableDictionary};
use crate::{CharString, Dialect, Document, TokenStringExt};

Expand Down
168 changes: 0 additions & 168 deletions harper-core/src/linting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,183 +197,15 @@ mod win_prize;
mod wordpress_dotcom;
mod would_never_have;

pub use a_part::APart;
pub use addicting::Addicting;
pub use adjective_double_degree::AdjectiveDoubleDegree;
pub use adjective_of_a::AdjectiveOfA;
pub use after_later::AfterLater;
pub use all_intents_and_purposes::AllIntentsAndPurposes;
pub use allow_to::AllowTo;
pub use am_in_the_morning::AmInTheMorning;
pub use amounts_for::AmountsFor;
pub use an_a::AnA;
pub use and_in::AndIn;
pub use and_the_like::AndTheLike;
pub use another_thing_coming::AnotherThingComing;
pub use another_think_coming::AnotherThinkComing;
pub use ask_no_preposition::AskNoPreposition;
pub use avoid_curses::AvoidCurses;
pub use back_in_the_day::BackInTheDay;
pub use be_allowed::BeAllowed;
pub use best_of_all_time::BestOfAllTime;
pub use boring_words::BoringWords;
pub use bought::Bought;
pub use cant::Cant;
pub use capitalize_personal_pronouns::CapitalizePersonalPronouns;
pub use cautionary_tale::CautionaryTale;
pub use change_tack::ChangeTack;
pub use chock_full::ChockFull;
pub use comma_fixes::CommaFixes;
pub use compound_nouns::CompoundNouns;
pub use compound_subject_i::CompoundSubjectI;
pub use confident::Confident;
pub use correct_number_suffix::CorrectNumberSuffix;
pub use criteria_phenomena::CriteriaPhenomena;
pub use currency_placement::CurrencyPlacement;
pub use dashes::Dashes;
pub use despite_of::DespiteOf;
pub use didnt::Didnt;
pub use discourse_markers::DiscourseMarkers;
pub use dot_initialisms::DotInitialisms;
pub use double_click::DoubleClick;
pub use double_modal::DoubleModal;
pub use ellipsis_length::EllipsisLength;
pub use everyday::Everyday;
pub use expand_memory_shorthands::ExpandMemoryShorthands;
pub use expand_time_shorthands::ExpandTimeShorthands;
pub use expr_linter::ExprLinter;
pub use far_be_it::FarBeIt;
pub use feel_fell::FeelFell;
pub use few_units_of_time_ago::FewUnitsOfTimeAgo;
pub use filler_words::FillerWords;
pub use find_fine::FindFine;
pub use for_noun::ForNoun;
pub use free_predicate::FreePredicate;
pub use friend_of_me::FriendOfMe;
pub use go_so_far_as_to::GoSoFarAsTo;
pub use have_pronoun::HavePronoun;
pub use have_take_a_look::HaveTakeALook;
pub use hedging::Hedging;
pub use hello_greeting::HelloGreeting;
pub use hereby::Hereby;
pub use hop_hope::HopHope;
pub use how_to::HowTo;
pub use hyphenate_number_day::HyphenateNumberDay;
pub use i_am_agreement::IAmAgreement;
pub use if_wouldve::IfWouldve;
pub use in_on_the_cards::InOnTheCards;
pub use inflected_verb_after_to::InflectedVerbAfterTo;
pub use initialism_linter::InitialismLinter;
pub use interested_in::InterestedIn;
pub use it_looks_like_that::ItLooksLikeThat;
pub use its_contraction::ItsContraction;
pub use its_possessive::ItsPossessive;
pub use left_right_hand::LeftRightHand;
pub use less_worse::LessWorse;
pub use let_to_do::LetToDo;
pub use lets_confusion::LetsConfusion;
pub use likewise::Likewise;
pub use lint::Lint;
pub use lint_group::{LintGroup, LintGroupConfig};
pub use lint_kind::LintKind;
pub use long_sentences::LongSentences;
pub use looking_forward_to::LookingForwardTo;
pub use map_phrase_linter::MapPhraseLinter;
pub use map_phrase_set_linter::MapPhraseSetLinter;
pub use mass_plurals::MassPlurals;
pub use merge_words::MergeWords;
pub use missing_preposition::MissingPreposition;
pub use missing_to::MissingTo;
pub use misspell::Misspell;
pub use mixed_bag::MixedBag;
pub use modal_of::ModalOf;
pub use modal_seem::ModalSeem;
pub use months::Months;
pub use more_better::MoreBetter;
pub use most_number::MostNumber;
pub use most_of_the_times::MostOfTheTimes;
pub use multiple_sequential_pronouns::MultipleSequentialPronouns;
pub use nail_on_the_head::NailOnTheHead;
pub use need_to_noun::NeedToNoun;
pub use no_french_spaces::NoFrenchSpaces;
pub use no_match_for::NoMatchFor;
pub use no_oxford_comma::NoOxfordComma;
pub use nobody::Nobody;
pub use noun_countability::NounCountability;
pub use noun_verb_confusion::NounVerbConfusion;
pub use number_suffix_capitalization::NumberSuffixCapitalization;
pub use of_course::OfCourse;
pub use on_floor::OnFloor;
pub use once_or_twice::OnceOrTwice;
pub use one_and_the_same::OneAndTheSame;
pub use open_the_light::OpenTheLight;
pub use orthographic_consistency::OrthographicConsistency;
pub use ought_to_be::OughtToBe;
pub use out_of_date::OutOfDate;
pub use oxford_comma::OxfordComma;
pub use oxymorons::Oxymorons;
pub use phrasal_verb_as_compound_noun::PhrasalVerbAsCompoundNoun;
pub use pique_interest::PiqueInterest;
pub use possessive_noun::PossessiveNoun;
pub use possessive_your::PossessiveYour;
pub use progressive_needs_be::ProgressiveNeedsBe;
pub use pronoun_are::PronounAre;
pub use pronoun_contraction::PronounContraction;
pub use pronoun_inflection_be::PronounInflectionBe;
pub use quantifier_needs_of::QuantifierNeedsOf;
pub use quantifier_numeral_conflict::QuantifierNumeralConflict;
pub use quite_quiet::QuiteQuiet;
pub use quote_spacing::QuoteSpacing;
pub use redundant_additive_adverbs::RedundantAdditiveAdverbs;
pub use regionalisms::Regionalisms;
pub use repeated_words::RepeatedWords;
pub use roller_skated::RollerSkated;
pub use safe_to_save::SafeToSave;
pub use save_to_safe::SaveToSafe;
pub use semicolon_apostrophe::SemicolonApostrophe;
pub use sentence_capitalization::SentenceCapitalization;
pub use shoot_oneself_in_the_foot::ShootOneselfInTheFoot;
pub use simple_past_to_past_participle::SimplePastToPastParticiple;
pub use since_duration::SinceDuration;
pub use single_be::SingleBe;
pub use some_without_article::SomeWithoutArticle;
pub use something_is::SomethingIs;
pub use somewhat_something::SomewhatSomething;
pub use sought_after::SoughtAfter;
pub use spaces::Spaces;
pub use spell_check::SpellCheck;
pub use spelled_numbers::SpelledNumbers;
pub use split_words::SplitWords;
pub use suggestion::Suggestion;
pub use take_serious::TakeSerious;
pub use that_than::ThatThan;
pub use that_which::ThatWhich;
pub use the_how_why::TheHowWhy;
pub use the_my::TheMy;
pub use then_than::ThenThan;
pub use theres::Theres;
pub use theses_these::ThesesThese;
pub use thing_think::ThingThink;
pub use though_thought::ThoughThought;
pub use throw_away::ThrowAway;
pub use throw_rubbish::ThrowRubbish;
pub use to_adverb::ToAdverb;
pub use to_two_too::ToTwoToo;
pub use touristic::Touristic;
pub use unclosed_quotes::UnclosedQuotes;
pub use update_place_names::UpdatePlaceNames;
pub use use_genitive::UseGenitive;
pub use verb_to_adjective::VerbToAdjective;
pub use very_unique::VeryUnique;
pub use vice_versa::ViceVersa;
pub use was_aloud::WasAloud;
pub use way_too_adjective::WayTooAdjective;
pub use well_educated::WellEducated;
pub use whereas::Whereas;
pub use widely_accepted::WidelyAccepted;
pub use win_prize::WinPrize;
pub use wordpress_dotcom::WordPressDotcom;
pub use would_never_have::WouldNeverHave;

use crate::{Document, LSend, render_markdown};

Expand Down
3 changes: 2 additions & 1 deletion harper-core/src/linting/more_better.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ impl ExprLinter for MoreBetter {

#[cfg(test)]
mod tests {
use crate::linting::{MoreBetter, tests::assert_suggestion_result};
use super::MoreBetter;
use crate::linting::tests::assert_suggestion_result;

#[test]
fn flag_most_biggest() {
Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/redundant_additive_adverbs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ impl ExprLinter for RedundantAdditiveAdverbs {

#[cfg(test)]
mod tests {
use crate::linting::{
RedundantAdditiveAdverbs,
tests::{assert_lint_count, assert_top3_suggestion_result},
};
use super::RedundantAdditiveAdverbs;
use crate::linting::tests::{assert_lint_count, assert_top3_suggestion_result};

// Basic unit tests

Expand Down
6 changes: 2 additions & 4 deletions harper-core/src/linting/semicolon_apostrophe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ impl ExprLinter for SemicolonApostrophe {

#[cfg(test)]
mod tests {
use crate::linting::{
SemicolonApostrophe,
tests::{assert_lint_count, assert_suggestion_result},
};
use super::SemicolonApostrophe;
use crate::linting::tests::{assert_lint_count, assert_suggestion_result};

#[test]
fn fix_dont_with_semicolon_to_apostrophe() {
Expand Down
2 changes: 1 addition & 1 deletion harper-core/src/linting/since_duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl ExprLinter for SinceDuration {

#[cfg(test)]
mod tests {
use crate::linting::SinceDuration;
use super::SinceDuration;
use crate::linting::tests::{assert_lint_count, assert_top3_suggestion_result};

#[test]
Expand Down
Loading
Loading