Skip to content

Commit 0889bf0

Browse files
authored
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`
1 parent d7aa283 commit 0889bf0

20 files changed

+41
-226
lines changed

harper-core/src/linting/after_later.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ impl ExprLinter for AfterLater {
7373

7474
#[cfg(test)]
7575
mod tests {
76-
use crate::linting::{AfterLater, tests::assert_top3_suggestion_result};
76+
use super::AfterLater;
77+
use crate::linting::tests::assert_top3_suggestion_result;
7778

7879
#[test]
7980
fn after_90_days_later() {

harper-core/src/linting/allow_to.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ impl ExprLinter for AllowTo {
5656

5757
#[cfg(test)]
5858
mod tests {
59-
use crate::linting::{
60-
AllowTo,
61-
tests::{assert_lint_count, assert_no_lints},
62-
};
59+
use super::AllowTo;
60+
use crate::linting::tests::{assert_lint_count, assert_no_lints};
6361

6462
#[test]
6563
fn flag_allow_to() {

harper-core/src/linting/and_in.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ impl ExprLinter for AndIn {
4646

4747
#[cfg(test)]
4848
mod tests {
49-
use crate::linting::{
50-
AndIn,
51-
tests::{assert_no_lints, assert_suggestion_result},
52-
};
49+
use super::AndIn;
50+
use crate::linting::tests::{assert_no_lints, assert_suggestion_result};
5351

5452
#[test]
5553
fn dont_flag_an_in_house() {

harper-core/src/linting/cautionary_tale.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ impl ExprLinter for CautionaryTale {
5757

5858
#[cfg(test)]
5959
mod tests {
60-
use crate::linting::{
61-
CautionaryTale,
62-
tests::{assert_lint_count, assert_suggestion_result},
63-
};
60+
use super::CautionaryTale;
61+
use crate::linting::tests::{assert_lint_count, assert_suggestion_result};
6462

6563
#[test]
6664
fn catches_cautionary_tail() {

harper-core/src/linting/change_tack.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ impl ExprLinter for ChangeTack {
6464

6565
#[cfg(test)]
6666
mod tests {
67-
use crate::linting::{ChangeTack, tests::assert_suggestion_result};
67+
use super::ChangeTack;
68+
use crate::linting::tests::assert_suggestion_result;
6869

6970
// Verbs: change tack
7071

harper-core/src/linting/far_be_it.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ impl ExprLinter for FarBeIt {
6565

6666
#[cfg(test)]
6767
mod tests {
68-
use crate::linting::{
69-
FarBeIt,
70-
tests::{assert_no_lints, assert_suggestion_count, assert_suggestion_result},
68+
use super::FarBeIt;
69+
use crate::linting::tests::{
70+
assert_no_lints, assert_suggestion_count, assert_suggestion_result,
7171
};
7272

7373
#[test]

harper-core/src/linting/go_so_far_as_to.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ impl ExprLinter for GoSoFarAsTo {
7777

7878
#[cfg(test)]
7979
mod tests {
80-
use crate::linting::{
81-
GoSoFarAsTo,
82-
tests::{assert_no_lints, assert_suggestion_result},
83-
};
80+
use super::GoSoFarAsTo;
81+
use crate::linting::tests::{assert_no_lints, assert_suggestion_result};
8482

8583
#[test]
8684
fn go_so_far_to() {

harper-core/src/linting/have_take_a_look.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,8 @@ impl ExprLinter for HaveTakeALook {
9393

9494
#[cfg(test)]
9595
mod tests {
96-
use crate::{
97-
Dialect,
98-
linting::{HaveTakeALook, tests::assert_suggestion_result},
99-
};
96+
use super::HaveTakeALook;
97+
use crate::{Dialect, linting::tests::assert_suggestion_result};
10098

10199
#[test]
102100
fn correct_taking_a_look() {

harper-core/src/linting/in_on_the_cards.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,10 @@ impl ExprLinter for InOnTheCards {
8888

8989
#[cfg(test)]
9090
mod tests {
91+
use super::InOnTheCards;
9192
use crate::{
9293
Dialect,
93-
linting::{
94-
InOnTheCards,
95-
tests::{assert_lint_count, assert_suggestion_result},
96-
},
94+
linting::tests::{assert_lint_count, assert_suggestion_result},
9795
};
9896

9997
// On the cards

harper-core/src/linting/lint_group.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use super::compound_subject_i::CompoundSubjectI;
4343
use super::confident::Confident;
4444
use super::correct_number_suffix::CorrectNumberSuffix;
4545
use super::criteria_phenomena::CriteriaPhenomena;
46+
use super::currency_placement::CurrencyPlacement;
4647
use super::despite_of::DespiteOf;
4748
use super::didnt::Didnt;
4849
use super::discourse_markers::DiscourseMarkers;
@@ -88,6 +89,7 @@ use super::lets_confusion::LetsConfusion;
8889
use super::likewise::Likewise;
8990
use super::long_sentences::LongSentences;
9091
use super::looking_forward_to::LookingForwardTo;
92+
use super::mass_plurals::MassPlurals;
9193
use super::merge_words::MergeWords;
9294
use super::missing_preposition::MissingPreposition;
9395
use super::missing_to::MissingTo;
@@ -104,9 +106,11 @@ use super::nail_on_the_head::NailOnTheHead;
104106
use super::need_to_noun::NeedToNoun;
105107
use super::no_french_spaces::NoFrenchSpaces;
106108
use super::no_match_for::NoMatchFor;
109+
use super::no_oxford_comma::NoOxfordComma;
107110
use super::nobody::Nobody;
108111
use super::nominal_wants::NominalWants;
109112
use super::noun_countability::NounCountability;
113+
use super::noun_verb_confusion::NounVerbConfusion;
110114
use super::number_suffix_capitalization::NumberSuffixCapitalization;
111115
use super::of_course::OfCourse;
112116
use super::on_floor::OnFloor;
@@ -116,6 +120,7 @@ use super::open_the_light::OpenTheLight;
116120
use super::orthographic_consistency::OrthographicConsistency;
117121
use super::ought_to_be::OughtToBe;
118122
use super::out_of_date::OutOfDate;
123+
use super::oxford_comma::OxfordComma;
119124
use super::oxymorons::Oxymorons;
120125
use super::phrasal_verb_as_compound_noun::PhrasalVerbAsCompoundNoun;
121126
use super::pique_interest::PiqueInterest;
@@ -179,15 +184,12 @@ use super::widely_accepted::WidelyAccepted;
179184
use super::win_prize::WinPrize;
180185
use super::wordpress_dotcom::WordPressDotcom;
181186
use super::would_never_have::WouldNeverHave;
182-
use super::{CurrencyPlacement, HtmlDescriptionLinter, Linter, NoOxfordComma, OxfordComma};
183187
use super::{ExprLinter, Lint};
188+
use super::{HtmlDescriptionLinter, Linter};
184189
use crate::linting::dashes::Dashes;
185190
use crate::linting::expr_linter::Chunk;
186191
use crate::linting::open_compounds::OpenCompounds;
187-
use crate::linting::{
188-
MassPlurals, NounVerbConfusion, closed_compounds, initialisms, phrase_corrections,
189-
phrase_set_corrections,
190-
};
192+
use crate::linting::{closed_compounds, initialisms, phrase_corrections, phrase_set_corrections};
191193
use crate::spell::{Dictionary, MutableDictionary};
192194
use crate::{CharString, Dialect, Document, TokenStringExt};
193195

0 commit comments

Comments
 (0)