-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Documentation followed by annotation comments #1090
Comments
Seems like a bug to me. I guess the intention was to exclude comment annotations from class/module documentation. @jonas054 should know more about this. |
Yes, it's bug. It should be the other way around IMO so that # Does fooing.
# FIXME: Not yet implemented.
class Foo is accepted, but # FIXME: Not yet implemented.
# Does fooing.
class Foo is not. It's very difficult to judge where the annotation ends, so I want to call the whole comment an annotation if the first line has an annotation keyword. |
I just saw that or own It would be confusing for users to get the So I'm thinking now that we should abondon the idea of trying to disregard the annotation comments in this cop, and just accept any comment. What do you think, @bbatsov @yujinakayama @agrimm? |
@jonas054 Guess we can assume annotation comments are one line long. |
@bbatsov Good idea. I've done so in the PR now. |
[Fix #1090] Correct handling of documentation vs annotation comment
Currently, the following code creates a Documentation offense:
This offense can be avoided by putting the FIXME line (the annotation comment) first.
Is this deliberate, or unintentional?
I assume that the annotation comment is about the implementation, while the non-annotation comment is about interface/intention, and that the latter is more likely to be relevant to someone reading the file. Therefore, non-annotation comments should appear first.
The text was updated successfully, but these errors were encountered: