mirror of
https://github.com/Automattic/harper.git
synced 2025-12-05 19:26:55 -06:00
refactor: most pub use lines in mod.rs not needed (#2259)
* refactor: most `pub use` lines in `mod.rs` not needed * fix: fmt * docs: new linters probably won't need `pub use` in `mod.rs`
This commit is contained in:
@@ -73,7 +73,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() {
|
||||
|
||||
@@ -56,10 +56,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() {
|
||||
|
||||
@@ -46,10 +46,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() {
|
||||
|
||||
@@ -57,10 +57,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() {
|
||||
|
||||
@@ -64,7 +64,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
|
||||
|
||||
|
||||
@@ -65,9 +65,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]
|
||||
|
||||
@@ -77,10 +77,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() {
|
||||
|
||||
@@ -93,10 +93,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() {
|
||||
|
||||
@@ -88,12 +88,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
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -179,15 +184,12 @@ 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::expr_linter::Chunk;
|
||||
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};
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -74,7 +74,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() {
|
||||
|
||||
@@ -117,10 +117,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
|
||||
|
||||
|
||||
@@ -65,10 +65,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() {
|
||||
|
||||
@@ -93,7 +93,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]
|
||||
|
||||
@@ -61,10 +61,8 @@ impl ExprLinter for ThatThan {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::linting::{
|
||||
ThatThan,
|
||||
tests::{assert_lint_count, assert_suggestion_result},
|
||||
};
|
||||
use super::ThatThan;
|
||||
use crate::linting::tests::{assert_lint_count, assert_suggestion_result};
|
||||
|
||||
// adj-er that
|
||||
|
||||
|
||||
@@ -106,7 +106,8 @@ impl ExprLinter for ThingThink {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::linting::{ThingThink, tests::assert_suggestion_result};
|
||||
use super::ThingThink;
|
||||
use crate::linting::tests::assert_suggestion_result;
|
||||
|
||||
// Pronouns
|
||||
|
||||
|
||||
@@ -62,10 +62,8 @@ impl ExprLinter for ThoughThought {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::linting::{
|
||||
ThoughThought,
|
||||
tests::{assert_no_lints, assert_suggestion_result},
|
||||
};
|
||||
use super::ThoughThought;
|
||||
use crate::linting::tests::{assert_no_lints, assert_suggestion_result};
|
||||
|
||||
#[test]
|
||||
fn fix_i_though_i() {
|
||||
|
||||
@@ -70,10 +70,8 @@ impl ExprLinter for VeryUnique {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::linting::{
|
||||
VeryUnique,
|
||||
tests::{assert_good_and_bad_suggestions, assert_top3_suggestion_result},
|
||||
};
|
||||
use super::VeryUnique;
|
||||
use crate::linting::tests::{assert_good_and_bad_suggestions, assert_top3_suggestion_result};
|
||||
|
||||
#[test]
|
||||
fn fix_very_unique() {
|
||||
|
||||
@@ -147,7 +147,6 @@ mod avoid_curses;
|
||||
mod boring_words;
|
||||
mod capitalize_personal_pronouns;
|
||||
// [svp! df:+]mod my_rule;
|
||||
// [svp! df:+]pub use my_rule::MyRule;
|
||||
```
|
||||
|
||||
Next, we need to configure whether your rule will be enabled by default.
|
||||
|
||||
Reference in New Issue
Block a user