Skip to content
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

Feature request: improve the behavior of --no-comment-check #2408

Closed
hhugo opened this issue Jul 21, 2023 · 4 comments · Fixed by #2456
Closed

Feature request: improve the behavior of --no-comment-check #2408

hhugo opened this issue Jul 21, 2023 · 4 comments · Fixed by #2456

Comments

@hhugo
Copy link
Collaborator

hhugo commented Jul 21, 2023

Ideally, --no-comment-check should not complain if an unattached doc comment (warning 50) becomes attached.
The current behavior is that we see an "Ast changed" error because there is an extra "doc" atttribute corresponding to that comment.

@Julow
Copy link
Collaborator

Julow commented Jul 25, 2023

The current error is correct in that the AST changes. Though, that might be acceptable behind a flag.

Do you have an example of an unattached doc comment that becomes attached ?

@hhugo
Copy link
Collaborator Author

hhugo commented Jul 25, 2023

The purpose of the request is to help classify bugs found in opam, I've added a bunch of problematic files in #985

@Julow
Copy link
Collaborator

Julow commented Jul 26, 2023

Thanks! I did not expect this bug to be possible but here's one example from your list:

open Vg
;;

(** Images for the documentation. *)

becomes:

open Vg

(** Images for the documentation. *);;

@hhugo
Copy link
Collaborator Author

hhugo commented Oct 5, 2023

Looking more into this, it seems that
Normalize_std_ast.equal ~ignore_doc_comments:true doesn't ignore floating doc comment inside Pctf_attribute, Psig_attribute, Pstr_attribute and Pcf_attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants