slevomat / coding-standard

Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
MIT License
1.39k stars 171 forks source link

[feature request] Force class/file comment #327

Closed gnumoksha closed 4 years ago

gnumoksha commented 6 years ago

I want to check if a class or file has a small comment describing its purpose, like Golang does for its packages. Is it relevant to this package? Can anyone indicate the way?

ondrejmirtes commented 6 years ago

Should be really easy to implement this by yourself. What have you tried?

On Wed, 4 Apr 2018 at 19:21, Tobias Sette notifications@github.com wrote:

I want to check if a class or file has a small comment describing its purpose, like Golang does for its packages https://blog.golang.org/godoc-documenting-go-code. Is it relevant to this package? Can anyone indicate the way?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slevomat/coding-standard/issues/327, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGZuFo5vuqP6bfqCmW9YvdUED2B21dNks5tlQExgaJpZM4THL-m .

--

Ondřej Mirtes

Majkl578 commented 6 years ago

You can take inspiration from ForbiddenComments sniff, what you want is basically inversion of that without the fixer part, plus some anchors which should be checked (i.e. class comment).

kukulich commented 6 years ago

@gnumoksha would you prepare PR for both sniffs (RequireClassCommentSniff and RequireFileCommentSniff) ?

gnumoksha commented 6 years ago

I have tried nothing yet, since I have no experience with phpcs. I will try to create both sniffers.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.