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

update to checkstyle 8.19 #158

Closed

Conversation

Bananeweizen
Copy link
Collaborator

@Bananeweizen Bananeweizen commented May 3, 2019

#145

  • use library 8.19
  • move tabWidth from TreeWalker to Check
  • add AnnotationLocation values and defaults

I've verified this version at runtime regarding the AnnotationLocation
changes, but I'm not sure where to verify the tabWidth changes in the
EclipseCS UI.

This is part of #145, but contains only the library upgrade, not the necessary version changes for the EclipseCS release (as Lars typically splits this into 2 commits).

@lkoe
Copy link
Member

lkoe commented May 3, 2019

Please note that the tabWidth setting of the active configuration is used to calculate editor annotations.
As the property moved this might not work anymore.
I'll look the thing up later, if you can't find it.

On version number update, yes I always do this as part of the release process, separate from the other changes.

@lkoe
Copy link
Member

lkoe commented May 3, 2019

calculatedColumn += mAdditionalConfigData.getTabWidth();

Coming from here:

ConfigurationReader.AdditionalConfigData additionalData = CheckerFactory

Ultimately originating from here:

public static AdditionalConfigData getAdditionalConfigData(InputSource in)

@rnveach
Copy link
Member

rnveach commented May 3, 2019

@lkoe

As the property moved this might not work anymore.

Just to confirm, property did not move, it was added to Checker and to all FileSets. Before this change it was only in Checks and TreeWalker. See checkstyle/checkstyle@87a3357#diff-f7f32abc19eaa1b7ce3ac0595324121a .
So all modules besides filters should be allowed to set tabWidth.
Our current preference is that the user set tabWidth in Checker over the old TreeWalker so it is used for the entire config.

@lkoe
Copy link
Member

lkoe commented May 3, 2019

@rnveach
Does it make sense to set tabWidth differently for different modules in a single configuration?
I would expect it do only be defined in a central spot.

In any case having tabWidth configured on potentially multiple places makes it much harder for eclipse-cs to figure out which tabWidth to use.
This calculation is necessary because Checkstyle warning column numbers are different to how the eclipse editor counts offset.

@rnveach
Copy link
Member

rnveach commented May 3, 2019

Does it make sense to set tabWidth differently for different modules in a single configuration?
I would expect it do only be defined in a central spot.

Before our change, all checks could configure tabWidths differently. You could specify it in TreeWalker, and override it in each individual check making them all have different widths. So adding it to more places wasn't that much different and at the time we thought it wasn't a bad idea.

When upgrading sonar plugin, this became a huge contention and long discussions. checkstyle/sonar-checkstyle#204 and checkstyle/sonar-checkstyle#209 .

We were leaning to how you suggest, only 1 place to set tabWidth but @romani deemed we should leave it as it is and discuss it in main repo and not change it now. See checkstyle/sonar-checkstyle#209 (comment) .
Nothing more has taken place on the subject.

This calculation is necessary because Checkstyle warning column numbers are different to how the eclipse editor counts offset.

Can you give me a basic example so we can understand better? How are the counts different from Checkstyle and Eclipse.

@romani
Copy link
Member

romani commented May 3, 2019

@Bananeweizen , please try to reference issue number in git commit message, it helps a lot. Commit message better to be "Issue #145: update to checkstyle 8.19"

@romani
Copy link
Member

romani commented May 3, 2019

deemed we should leave it as it is and discuss it in main repo and not change it now.

Yes, let's keep it for now as is, as it did not make any problems before, it is ok to keep it. We need to analyse proposed change before making it.

@rnveach
Copy link
Member

rnveach commented May 3, 2019

@romani

BIN -11 MB net.sf.eclipsecs.checkstyle/checkstyle-8.18-all.jar
BIN +23.1 MB net.sf.eclipsecs.checkstyle/checkstyle-8.19-all.jar

Do you know what caused checkstyle all jar to basically double in size in 1 release?
https://github.com/checkstyle/checkstyle/releases

@romani
Copy link
Member

romani commented May 3, 2019

size issue was moved to checkstyle/checkstyle#6713

* use library 8.19
* move tabWidth from TreeWalker to Check
* add AnnotationLocation values and defaults
* get tabwidth from either TreeWalker or Checker (whatever first
declares the attribute)
@Bananeweizen
Copy link
Collaborator Author

I've modified the ConfigurationReader to take the tabWidth from the first occurrence at either Checker or TreeWalker now. Please be aware that I could not run the newly added tests locally (due my company firewall restricting the Internet access), so I will have to fix potential test failures from a private machine tomorrow.

@rnveach
Copy link
Member

rnveach commented May 5, 2019

travis:

[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: net.sf.eclipsecs.feature.group 8.18.0.qualifier
[ERROR] Missing requirement: net.sf.eclipsecs.feature.group 8.18.0.qualifier requires 'org.eclipse.equinox.p2.iu; net.sf.eclipsecs.checkstyle [8.18.0,8.18.1)' but it could not be found
[ERROR]

@@ -2,21 +2,21 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Checkstyle Library
Bundle-SymbolicName: net.sf.eclipsecs.checkstyle
Bundle-Version: 8.18.0.qualifier
Bundle-Version: 8.19.0.qualifier
Copy link
Member

Choose a reason for hiding this comment

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

This accidental number update causes the build to fail

@romani
Copy link
Member

romani commented Jun 16, 2019

@Bananeweizen , please find time to finish this PR.

@romani
Copy link
Member

romani commented Oct 31, 2019

This is PR is abandoned ....
upgrade will be done in scope of #167

@romani romani closed this Oct 31, 2019
@Bananeweizen Bananeweizen deleted the useCheckstyle8.19 branch January 7, 2020 16:07
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.

None yet

4 participants