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

Replace libdparse with DMD in HasPublicExampleCheck #130

Merged

Conversation

Vladiwostok
Copy link
Collaborator

This check warns for public and documented declarations that do not have a documented unit test attached. This check is fairly modest, as a documented unit test "attaches" only to the previous declaration (so there's a possibility that there's a unit test that doesn't test a declaration, and it won't warn).
In libdparse version, I've noticed a few things:

  • the module is not visited, however it's declarations are directly checked; this was not identically possible in DMD;
  • old check only looks for a few declarations: classes, interfaces, structs, unions, functions and templates;
  • because of the check's behavior and libdparse Module ASTNode, conditional declarations are completely ignored (such as a module-level 'version' block) - I've kept the same behavior in DMD version;
  • the check's DDoc mentions that enums are not checked, however enum checking does appear in code; on further inspections (and testing it against enums in phobos), I've noticed that enums are in fact NOT checked, due to libdparse Module ASTNode; I've kept the same behaviour;
  • the visitor intends to skip non-public declarations, however in the actual code only non-private, non-protected or non-package declarations are checked (that means 'export' declarations are also checked) - kept the same behavior, but should this be intended?

@RazvanN7
Copy link
Collaborator

Mind the conflict.

@RazvanN7 RazvanN7 merged commit cc726c8 into Dlang-UPB:replace_libdparse Aug 12, 2024
17 checks passed
@Vladiwostok Vladiwostok deleted the has-public-example branch August 12, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace libdparse with DMD in HasPublicExampleCheck
2 participants