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

exported: comment starting with "Deprecated:” should be ignored when checking if a comment is present #1231

Open
ccoVeille opened this issue Feb 12, 2025 · 2 comments

Comments

@ccoVeille
Copy link
Contributor

ccoVeille commented Feb 12, 2025

// Foo does the magic
func Foo() {}

// Bar is blah blah
//
// Deprecated: use Foo
func Bar() {}

//nolint:whatever
func Baz() {}

// Deprecated: is deprecated
func Qux() {}

func Quux() {}

The first two are valid

The third one is fixed by a previous PR:

And is now reported as: "exported func Baz should have comment or be unexported"

The last one is reported as: "exported func Quux should have comment or be unexported"

The issue is with Qux, the error reported is "comment should be like Qux ...", but in fact here it should be "exported function should have a comment", the very same way Baz is reported

@ccoVeille ccoVeille changed the title exported: exported: comment starting with "Deprecated:” should be ignored when checking if a comment is present Feb 12, 2025
@ccoVeille
Copy link
Contributor Author

Reminder:

nit: in the next PR please add a comment explaining that .Text removes directives from the comment block
Originally posted by @chavacava in #1209 (comment)

@chavacava
Copy link
Collaborator

@ccoVeille , the proposal LGTM.

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

No branches or pull requests

2 participants