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
LineLength check documentation incorrectly shows how to work with tabWidth property #13005
Comments
attention that LineLength is not a child of TreeWalker to reuse or be affected by its property.
https://checkstyle.org/config.html#Checker has property tabWidth , use it. |
Okay, thanks. I guess that must be fairly new? |
Sad documentation defect https://checkstyle.org/config_sizes.html#LineLength_Notes
We need to change Treewalker to Checker. |
@danielrcollins1, do you have time to send Pull Request to fix it ? |
Hey i would like to take up this issue. |
no assignments, just do comment "I am on it" and start working on any issue that is approved. |
i am on it. |
…ws how to work with tabWidth property
I am on it |
…ows how to work with tabWidth property
…ows how to work with tabWidth property
…ows how to work with tabWidth property
…ows how to work with tabWidth property Issue checkstyle#13005: LineLength check documentation incorrectly shows how to work with tabWidth property
…ows how to work with tabWidth property Issue checkstyle#13005: LineLength check documentation incorrectly shows how to work with tabWidth property
…ows how to work with tabWidth property
Fix is merged |
Sad documentation defect
https://checkstyle.org/config_sizes.html#LineLength_Notes
We need to change Treewalker to Checker.
Line to change
checkstyle/src/xdocs/config_sizes.xml
Line 606 in fc2bdfe
I have read check documentation: https://checkstyle.org/config_xxxxxx.html#NameOfAffectedCheck
I have downloaded the latest checkstyle from: https://checkstyle.org/cmdline.html#Download_and_Run
I have executed the cli and showed it below, as cli describes the problem better than 1,000 words
The documentation for LineLength says that it honors the TreeWalker tabWidth property, but it does not seem to do so in practice (https://checkstyle.org/config_sizes.html#LineLength).
The sample code file in its second line has 2 tab characters, followed by 70 digits. The config file has tabWidth set to 3, so this should be counted as 76 total characters, and within the default limit of 80 for LineLength. But instead this is counted as 86 characters (what you get if tabs are counted as the default 8 spaces wide each; 70 + 8 + 8 = 86), and thus triggers the LineLength error.
I've also tried setting the tabWidth property within the LineLenth module (as documentation says should work), but that has the same result.
Config.xml.txt
TestLongLine.java.txt
The text was updated successfully, but these errors were encountered: