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

Rationalize and apply consistent project settings #2748

Merged
merged 8 commits into from
Feb 12, 2018
Merged

Conversation

briandealwis
Copy link
Member

This PR creates and applies a canonical set of project settings and preferences for JDT, PDE, and m2e.

The PR uses the eclipse-settings-maven-plugin to apply a set of settings files as packaged up in a Maven jar artifact. The settings artifact project is found in eclipse/settings/. This settings artifact could be published as a canonical set of settings files (e.g., to Maven Central com.google:java-settings-eclipse), though I've included instructions for how to apply changes locally.

The settings are based on the GoogleStyle settings from GPE with a few tweaks (described in the eclipse/settings/README.md). One notable change: it requires us to install the Google Java Format plugin (details in README.md).

I changed the repo structure to make /plugins, /features and /third_party to be separate module projects that pull in their child project. This simplifies the main /pom.xml and also allows configuring different settings for those children (i.e., to not configure eclipse-settings-maven-plugin on third_party).

The nice thing about this approach is that it simplifies configuring new projects — just invoke the eclipse-settings plugin.

This is part of #109

@briandealwis
Copy link
Member Author

Funny, the JDT compiler uses the settings and has flagged things as errors, but my Eclipse instance didn't.

@briandealwis
Copy link
Member Author

briandealwis commented Jan 24, 2018

The google-java-format insists on // comments to have a leading space, but the Eclipse //$NON-NLS-n$ externalized-string scanner doesn't like it. (google/google-java-format#221)

@briandealwis
Copy link
Member Author

An alternative is to continue using the GPE GoogleStyle formatting settings, which is what we were mostly using, and not use the google-java-format plugin.

@codecov
Copy link

codecov bot commented Jan 26, 2018

Codecov Report

Merging #2748 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2748      +/-   ##
============================================
+ Coverage     68.25%   68.29%   +0.03%     
- Complexity     2515     2516       +1     
============================================
  Files           347      347              
  Lines         12211    12211              
  Branches       1465     1465              
============================================
+ Hits           8335     8339       +4     
+ Misses         3288     3285       -3     
+ Partials        588      587       -1
Impacted Files Coverage Δ Complexity Δ
...se/appengine/validation/AppEngineJreWhitelist.java 21.15% <ø> (ø) 9 <0> (ø) ⬇️
...calAppEngineServerLaunchConfigurationDelegate.java 64.61% <0%> (+0.32%) 38% <0%> (ø) ⬇️
.../tools/eclipse/test/util/project/ProjectUtils.java 69.31% <0%> (+1.7%) 37% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6af25f...3ce90d6. Read the comment docs.

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

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

We should probably cut the next release before we commit this in case anything goes south.


- uses the [Google Java Format plugin for Eclipse](google-java-format),
which requires Eclipse Oxygen (4.7) or later.
- unnecessary declared exceptions on methods are _errors_
Copy link
Contributor

Choose a reason for hiding this comment

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

runtime too or just checked?

Copy link
Member Author

Choose a reason for hiding this comment

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

Checked exceptions only.

The settings require installing the [Google Java Format plugin for
Eclipse][google-java-format]. Installing the format plugin requires
downloading the [latest release][google-java-format-release] (named
`google-java-format-eclipse-plugin_XXXX.jar`)and placing the jar
Copy link
Contributor

Choose a reason for hiding this comment

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

space after )

Updating and applying the settings files is a two-step process based
around the [`eclipse-settings-maven-plugin`][esmp] Maven plugin.

[esmp]: https://github.com/BSI-Business-Systems-Integration-AG/eclipse-settings-maven-plugin
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer direct inline links but up to you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Me too, but the text was becoming hard to read :-/

@elharo elharo mentioned this pull request Jan 31, 2018
@elharo
Copy link
Contributor

elharo commented Feb 2, 2018

Can this be merged now?

@briandealwis
Copy link
Member Author

If we decide to use the google-java-format plugin, then I think we need to disable the $NON-NLS-<x>$ warning.

@briandealwis
Copy link
Member Author

Changed the configuration to ignore non-externalized strings / missing $NON-NLS-x$.
Tweaked the READMEs slightly.
Re-applied the settings.
PTAL.

@briandealwis
Copy link
Member Author

Eclipse bug 215466 requests tolerating spaces in //$NON-NLS.

@briandealwis briandealwis merged commit 4218f5a into master Feb 12, 2018
@briandealwis briandealwis deleted the i109-settings branch February 12, 2018 17:05
@elharo
Copy link
Contributor

elharo commented Feb 13, 2018

Travis is failing in weird ways that might be caused by this. E.g. see #2789

#2785 may fix this, but if not we might want to roll this back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants