Skip to content

feature: highly kept (secret)→well-kept #1045

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

Merged
merged 5 commits into from
Apr 7, 2025
Merged
Changes from 2 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
25 changes: 25 additions & 0 deletions harper-core/src/linting/phrase_corrections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,13 @@ pub fn lint_group() -> LintGroup {
"Use `without` instead of `w/o`",
"Expands the abbreviation `w/o` to the full word `without` for clarity."
),
"WellKept" => (
["highly-kept", "highly kept"],
// There may be other good alternatives such as closely-guarded or tightly-held
["well-kept"],
"`Highly-kept` is not standard. To describe secrets, `well-kept` is the most used phrase.",
"Flags `highly-kept` and recommends `well-kept` as an alternative."
)
});

group.set_all_rules_to(Some(true));
Expand Down Expand Up @@ -1755,4 +1762,22 @@ mod tests {
"Another possible cause is simply that the application does not have file creation permissions on the other machine.",
);
}

#[test]
fn correct_highly_kept_space() {
assert_suggestion_result(
"I assure you that frequency/angle dependence is a highly kept secret.",
lint_group(),
"I assure you that frequency/angle dependence is a well-kept secret.",
);
}

#[test]
fn correct_highly_kept_no_hyphen() {
assert_suggestion_result(
"Well, Kushina's giving birth was already a highly-kept secret so it makes sense to operate with only the completely necessary personnel.",
lint_group(),
"Well, Kushina's giving birth was already a well-kept secret so it makes sense to operate with only the completely necessary personnel.",
);
}
}