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

Add TODO Comment Checker and associated unit tests #134

Merged
merged 3 commits into from
Oct 17, 2015
Merged

Add TODO Comment Checker and associated unit tests #134

merged 3 commits into from
Oct 17, 2015

Conversation

rigoford
Copy link
Contributor

Not sure what happened to the old pull request (#133). This one covers off a couple of suggestions by HairyFotr

@rigoford
Copy link
Contributor Author

rigoford commented Mar 2, 2015

Added a FIXME check as requested by HairyFotr

</example-configuration>
</check>

<check id="fixme.comment">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be in twice

@matthewfarwell
Copy link
Member

@HairyFotr It seems like overkill to have two classes. Please note that you can have the same class twice in the configuration, but with different parameters. Could you confirm that this would be acceptable?

/**
* Checks for line comment style FIXMEs
*/
class FixmeCommentChecker extends FileChecker {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be exactly the same code as the FixmeCommentChecker - you could use the same abstract class for them both. Also, I'm not sure that we need both classes anyway - see general comments.

@HairyFotr
Copy link
Contributor

Cool, I didn't know the same class can be used multiple times. Yes, one class is enough, then.

@rigoford
Copy link
Contributor Author

So I've created an abstract class for Todo and Fixme to extend. I wasn't sure about using just one class. How would the errorKey and id work?

@matthewfarwell
Copy link
Member

Sorry it took so long to get back to this. Could you do a rebase and a squash for this please?

Change-Id: I0e9059fe00491c03bb8efe0590cc51bb25e3e1df
@rigoford
Copy link
Contributor Author

rigoford commented Aug 4, 2015

Rebased and squashed as requested. It should be good.

@matthewfarwell
Copy link
Member

I'm going to accept this PR, but I think we can do better for configuration - the regex seems very complicated and hard to get right. I'll change it to have one single string where you can specify TODO or FIXME etc, similarly to http://checkstyle.sourceforge.net/apidocs/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheck.html

matthewfarwell added a commit that referenced this pull request Oct 17, 2015
Add TODO Comment Checker and associated unit tests
@matthewfarwell matthewfarwell merged commit 3354423 into scalastyle:master Oct 17, 2015
kitbellew pushed a commit to kitbellew/scalastyle that referenced this pull request Jul 3, 2021
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.

3 participants