Skip to content

Commit

Permalink
docs(ast): enable crate-wide warnings on missing doc comments (#6716)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Oct 24, 2024
1 parent ca79993 commit 63ce9be
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)] // FIXME

// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
// Read [`macro@oxc_ast_macros::ast`] for more information.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_ast/src/ast/jsx.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! [JSX](https://facebook.github.io/jsx)
#![warn(missing_docs)]
// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_ast/src/ast/literal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Literals
#![warn(missing_docs)]
// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//!
//! - [AST Spec](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/ast-spec)
//! - [Archived TypeScript spec](https://github.com/microsoft/TypeScript/blob/3c99d50da5a579d9fa92d02664b1b66d4ff55944/doc/spec-ARCHIVED.md)
#![allow(missing_docs)] // FIXME

// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code.
// They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_ast/src/ast_impl/jsx.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! [JSX](https://facebook.github.io/jsx)
#![warn(missing_docs)]
use std::fmt;

use oxc_span::Atom;
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_ast/src/ast_impl/literal.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Literals
#![warn(missing_docs)]
use std::{
borrow::Cow,
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_ast/src/ast_kind_impl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(missing_docs)] // FIXME
use oxc_span::Atom;
use oxc_syntax::scope::ScopeId;

Expand Down
1 change: 0 additions & 1 deletion crates/oxc_ast/src/generated/ast_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
clippy::too_many_arguments,
clippy::fn_params_excessive_bools
)]
#![warn(missing_docs)]

use std::cell::Cell;

Expand Down
3 changes: 3 additions & 0 deletions crates/oxc_ast/src/generated/ast_kind.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/ast_kind.rs`

#![allow(missing_docs)]
// FIXME (in ast_tools/src/generators/ast_kind.rs)

use oxc_span::{GetSpan, Span};

#[allow(clippy::wildcard_imports)]
Expand Down
3 changes: 3 additions & 0 deletions crates/oxc_ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// TODO: I'm not sure if it is a but or intentional but clippy needs this allowed both on this
// module and the generated one.
#![allow(clippy::self_named_module_files)]
#![warn(missing_docs)]

//! # Oxc AST
//!
Expand Down Expand Up @@ -36,6 +37,7 @@ pub mod precedence;
mod trivia;

mod generated {
#![allow(missing_docs)]
#[cfg(debug_assertions)]
pub mod assert_layouts;
pub mod ast_builder;
Expand All @@ -52,6 +54,7 @@ mod generated {
}

pub mod visit {
#![allow(missing_docs)]
pub use crate::generated::{visit::*, visit_mut::*};
}

Expand Down
1 change: 1 addition & 0 deletions crates/oxc_ast/src/precedence.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! [Expression precedence trait](GetPrecedence) implementations.
use oxc_syntax::precedence::{GetPrecedence, Precedence};

use crate::ast::{
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_ast/src/trivia.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Trivias such as comments and irregular whitespaces
#![allow(missing_docs)] // FIXME

use std::{
iter::FusedIterator,
Expand Down
1 change: 0 additions & 1 deletion tasks/ast_tools/src/generators/ast_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl Generator for AstBuilderGenerator {
clippy::too_many_arguments,
clippy::fn_params_excessive_bools,
)]
#![warn(missing_docs)]

///@@line_break
use std::cell::Cell;
Expand Down
2 changes: 2 additions & 0 deletions tasks/ast_tools/src/generators/ast_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ impl Generator for AstKindGenerator {
path: output(crate::AST_CRATE, "ast_kind.rs"),
tokens: quote! {
#header
#![allow(missing_docs)] ///@ FIXME (in ast_tools/src/generators/ast_kind.rs)
///@@line_break
use oxc_span::{GetSpan, Span};

Expand Down

0 comments on commit 63ce9be

Please sign in to comment.