Closed maxvetrenko closed 10 years ago
please make sure that list of tokenType that could not be split in few lines could be specified and adjusted by user.
1) HTML site should be updated to have documentation.
2) remove "@version" from javadoc
3) keep only one example of usage, default example could be removed.
4) please do squash of all commit in one - I need to see final changes.
1) HTML site should be updated to have documentation. How to update HTML?
Updated site, code coverage is 100%
1)
avoid to wrap import ....
Should be "restrict to wrap ....."
2) please provide Examples of line-wrapped import and package and how Check force it looks like . Remember that users understand better by example rather then by academic description.
3) I do not see changes for xdoc files (we site).
Updated xdoc files
... but it's possible to check any statement. return new int[] {TokenTypes.PACKAGE_DEF, TokenTypes.IMPORT};
Where is the truth?
Examples of line-wrapped import and package:
Change to "Examples of line-wrapped statements"
Examples without line-wrapping import and package statements:
Change to "Examples of not line-wrapped statements"
- @Test
- public void testBadCaseWithTokenConfig() throws Exception
- {
- final DefaultConfiguration checkConfig = createCheckConfig(NoLineWrapCheck.class);
- checkConfig.addAttribute("tokens", "IMPORT");
- final String[] expected = {
- "6: import statement should not be line-wrapped.",
- };
- verify(checkConfig, getPath("whitespace/NoLineWrapBadInput.java"), expected);
- }
I don't understand what are you trying to test here. Your previous test already covers such a case.
final DefaultConfiguration checkConfig = createCheckConfig(NoLineWrapCheck.class);
- checkConfig.addAttribute("tokens", "IMPORT");
Could you add other tokens (class, method, fields, etc.) and extend your testinput in order so we can see that other statemens are also covered.
Done.
@Override
- public int[] getRequiredTokens() {
- Use public int[] getAcceptableTokens() method instead
- Update a list of acceptable tokens. Look at all TokenTypes.*_DEF. Does it make sense to include them all?
public void testGoodCase() public void testBadCase() public void testBadCaseWithTokenConfig()
Bad names. Each test has to have a clear name which reflects its purpose.
Use public int[] getAcceptableTokens() method instead
I don't agree with you. getRequiredTokens return tokens that MAY set as a property and getAcceptableTokens uses to protect getDefaultTokens.
Does it make sense to include them all?
I think, that it make sense to include method, class, enum, ctor and interface
Bad names. Each test has to have a clear name which reflects its purpose.
Done. Check it
By default this Check
- * restrict to wrap import and package statements
Change to "By default this Check restricts wrapping import and package statements"
testCaseWithLineWrapping()
Change to "testDefaultTokensLineWrapping"
testCaseWithLineWrappingAndCustomTokensToCheck()
Change to "testCustomTokensLineWrapping"
By default this Check restrict to wrap import and package statements
Change to "By default this Check restricts wrapping import and package statements"
Please change it everywhere
1)
Examples of not line-wrapped statements:
JavaDoc is not a place for code examples! All example a re placed for reason. please provide config that force code to be like this.
- Done
I do not see any meaningful changes, that will bind example configuration and examples
It's my changes: commit. If something is wrong, let's discuss via Skype.
ok for PR, please donot forget to create issue in Checkstyle repo and make a link to it in commit message.
Merged
http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s3.3.2-import-line-wrapping http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s3.2-package-statement
The package and import statements are not line-wrapped.