Skip to content

Commit

Permalink
Auto merge of #11892 - y21:actually_rename_doc_for_real_this_time, r=…
Browse files Browse the repository at this point in the history
…Manishearth

rename `DocMarkdown` pass to `Documentation`

Followup of #11801

This was discussed in todays meeting: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Meeting.202023-11-28/near/404667082

Decided to go with `Documentation`, because this would also make it consistent with how `Attributes` is named in `attrs.rs` (and it also sounds good).

changelog: none
  • Loading branch information
bors committed Nov 28, 2023
2 parents e6f3390 + 0565267 commit 91c5653
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions clippy_lints/src/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,14 @@ declare_clippy_lint! {
"suspicious usage of (outer) doc comments"
}

#[expect(clippy::module_name_repetitions)]
#[derive(Clone)]
pub struct DocMarkdown {
pub struct Documentation {
valid_idents: FxHashSet<String>,
in_trait_impl: bool,
check_private_items: bool,
}

impl DocMarkdown {
impl Documentation {
pub fn new(valid_idents: &[String], check_private_items: bool) -> Self {
Self {
valid_idents: valid_idents.iter().cloned().collect(),
Expand All @@ -323,7 +322,7 @@ impl DocMarkdown {
}
}

impl_lint_pass!(DocMarkdown => [
impl_lint_pass!(Documentation => [
DOC_LINK_WITH_QUOTES,
DOC_MARKDOWN,
MISSING_SAFETY_DOC,
Expand All @@ -334,7 +333,7 @@ impl_lint_pass!(DocMarkdown => [
SUSPICIOUS_DOC_COMMENTS
]);

impl<'tcx> LateLintPass<'tcx> for DocMarkdown {
impl<'tcx> LateLintPass<'tcx> for Documentation {
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
let attrs = cx.tcx.hir().attrs(hir::CRATE_HIR_ID);
check_attrs(cx, &self.valid_idents, attrs);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
avoid_breaking_exported_api,
))
});
store.register_late_pass(move |_| Box::new(doc::DocMarkdown::new(doc_valid_idents, check_private_items)));
store.register_late_pass(move |_| Box::new(doc::Documentation::new(doc_valid_idents, check_private_items)));
store.register_late_pass(|_| Box::new(neg_multiply::NegMultiply));
store.register_late_pass(|_| Box::new(let_if_seq::LetIfSeq));
store.register_late_pass(|_| Box::new(mixed_read_write_in_expression::EvalOrderDependence));
Expand Down

0 comments on commit 91c5653

Please sign in to comment.