docs(ast): enable crate-wide warnings on missing doc comments (#6716)

Part of https://github.com/oxc-project/backlog/issues/130
This commit is contained in:
DonIsaac 2024-10-24 01:40:39 +00:00
parent ca799936b0
commit 63ce9bec24
14 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,5 @@
#![allow(missing_docs)] // FIXME
// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code. // 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. // 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. // Read [`macro@oxc_ast_macros::ast`] for more information.

View file

@ -1,5 +1,4 @@
//! [JSX](https://facebook.github.io/jsx) //! [JSX](https://facebook.github.io/jsx)
#![warn(missing_docs)]
// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code. // 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. // They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

View file

@ -1,5 +1,4 @@
//! Literals //! Literals
#![warn(missing_docs)]
// NB: `#[span]`, `#[scope(...)]`,`#[visit(...)]` and `#[generate_derive(...)]` do NOT do anything to the code. // 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. // They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

View file

@ -2,6 +2,7 @@
//! //!
//! - [AST Spec](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/ast-spec) //! - [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) //! - [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. // 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. // They are purely markers for codegen used in `tasks/ast_tools` and `crates/oxc_traverse/scripts`. See docs in those crates.

View file

@ -1,5 +1,4 @@
//! [JSX](https://facebook.github.io/jsx) //! [JSX](https://facebook.github.io/jsx)
#![warn(missing_docs)]
use std::fmt; use std::fmt;
use oxc_span::Atom; use oxc_span::Atom;

View file

@ -1,5 +1,4 @@
//! Literals //! Literals
#![warn(missing_docs)]
use std::{ use std::{
borrow::Cow, borrow::Cow,

View file

@ -1,3 +1,4 @@
#![allow(missing_docs)] // FIXME
use oxc_span::Atom; use oxc_span::Atom;
use oxc_syntax::scope::ScopeId; use oxc_syntax::scope::ScopeId;

View file

@ -7,7 +7,6 @@
clippy::too_many_arguments, clippy::too_many_arguments,
clippy::fn_params_excessive_bools clippy::fn_params_excessive_bools
)] )]
#![warn(missing_docs)]
use std::cell::Cell; use std::cell::Cell;

View file

@ -1,6 +1,9 @@
// Auto-generated code, DO NOT EDIT DIRECTLY! // Auto-generated code, DO NOT EDIT DIRECTLY!
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/ast_kind.rs` // 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}; use oxc_span::{GetSpan, Span};
#[allow(clippy::wildcard_imports)] #[allow(clippy::wildcard_imports)]

View file

@ -2,6 +2,7 @@
// TODO: I'm not sure if it is a but or intentional but clippy needs this allowed both on this // 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. // module and the generated one.
#![allow(clippy::self_named_module_files)] #![allow(clippy::self_named_module_files)]
#![warn(missing_docs)]
//! # Oxc AST //! # Oxc AST
//! //!
@ -36,6 +37,7 @@ pub mod precedence;
mod trivia; mod trivia;
mod generated { mod generated {
#![allow(missing_docs)]
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
pub mod assert_layouts; pub mod assert_layouts;
pub mod ast_builder; pub mod ast_builder;
@ -52,6 +54,7 @@ mod generated {
} }
pub mod visit { pub mod visit {
#![allow(missing_docs)]
pub use crate::generated::{visit::*, visit_mut::*}; pub use crate::generated::{visit::*, visit_mut::*};
} }

View file

@ -1,3 +1,4 @@
//! [Expression precedence trait](GetPrecedence) implementations.
use oxc_syntax::precedence::{GetPrecedence, Precedence}; use oxc_syntax::precedence::{GetPrecedence, Precedence};
use crate::ast::{ use crate::ast::{

View file

@ -1,4 +1,5 @@
//! Trivias such as comments and irregular whitespaces //! Trivias such as comments and irregular whitespaces
#![allow(missing_docs)] // FIXME
use std::{ use std::{
iter::FusedIterator, iter::FusedIterator,

View file

@ -45,7 +45,6 @@ impl Generator for AstBuilderGenerator {
clippy::too_many_arguments, clippy::too_many_arguments,
clippy::fn_params_excessive_bools, clippy::fn_params_excessive_bools,
)] )]
#![warn(missing_docs)]
///@@line_break ///@@line_break
use std::cell::Cell; use std::cell::Cell;

View file

@ -131,6 +131,8 @@ impl Generator for AstKindGenerator {
path: output(crate::AST_CRATE, "ast_kind.rs"), path: output(crate::AST_CRATE, "ast_kind.rs"),
tokens: quote! { tokens: quote! {
#header #header
#![allow(missing_docs)] ///@ FIXME (in ast_tools/src/generators/ast_kind.rs)
///@@line_break
use oxc_span::{GetSpan, Span}; use oxc_span::{GetSpan, Span};