Skip to content

docs(ast): add allow(missing_docs) to all remaining fields for JS/TS nodes#8827

Closed
camchenry wants to merge 1 commit intomainfrom
02-01-docs_ast_add_allow_missing_docs_to_all_remaining_fields_for_js_ts_nodes
Closed

docs(ast): add allow(missing_docs) to all remaining fields for JS/TS nodes#8827
camchenry wants to merge 1 commit intomainfrom
02-01-docs_ast_add_allow_missing_docs_to_all_remaining_fields_for_js_ts_nodes

Conversation

@camchenry
Copy link
Member

@camchenry camchenry commented Feb 1, 2025

Requires that all new fields/structs/enums in the JS and TS files must have documentation.

@github-actions github-actions bot added the A-ast Area - AST label Feb 1, 2025
Copy link
Member Author

camchenry commented Feb 1, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-docs Category - Documentation. Related to user-facing or internal documentation label Feb 1, 2025
@camchenry camchenry marked this pull request as ready for review February 1, 2025 18:56
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 1, 2025

CodSpeed Performance Report

Merging #8827 will not alter performance

Comparing 02-01-docs_ast_add_allow_missing_docs_to_all_remaining_fields_for_js_ts_nodes (52eb944) with main (0568210)

Summary

✅ 33 untouched benchmarks

@camchenry camchenry force-pushed the 02-01-docs_ast_add_allow_missing_docs_to_all_remaining_fields_for_js_ts_nodes branch from fa47337 to 52eb944 Compare February 1, 2025 20:42
Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too much of a noise 🤔

@overlookmotel
Copy link
Member

I'm afraid I tend to agree.

In fact, I'm not sure our aim should be to document every single struct field or enum variant. I am really big on code comments but, even with my pro-comments bent, I find that when the meaning is really obvious already, comments can take away readability more than they contribute to it, because they break up the code too much.

(I am thinking of how comments appear in the code itself, rather than the generated docs)

It's tricky! We ideally do want everything which isn't obvious documented, and lint rules prevent anyone forgetting to do that. But of course there's no way to teach clippy what's "important" and what's not.

For Span fields (#8828), it'd be extremely repetitious to have a comment on every single type. For that one, I suggest injecting the comments in the ast proc macro. That's trivial to do, and won't be too slow at compile time, as it's not complex code to generate. So that'd give us our cake (generated docs) and eat it too (no repetitious comments in the code). I've just overhauled oxc_ast_tools (#8844), which will make it easier to do that kind of thing. What do you think?

@Boshen Boshen closed this Feb 3, 2025
@camchenry camchenry deleted the 02-01-docs_ast_add_allow_missing_docs_to_all_remaining_fields_for_js_ts_nodes branch August 17, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants