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

intellij-java-google-style.xml puts static imports last #26

Open
GoogleCodeExporter opened this issue Apr 28, 2015 · 3 comments
Open

intellij-java-google-style.xml puts static imports last #26

GoogleCodeExporter opened this issue Apr 28, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

According to 

http://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s3.3.3-import-o
rdering-and-spacing

"Import statements are divided into the following groups, in this order, with 
each group separated by a single blank line:
1. All static imports in a single group ..."

static imports should come first. But in intellij-java-google-style.xml they 
are listed as last:

https://code.google.com/p/google-styleguide/source/browse/trunk/intellij-java-go
ogle-style.xml#251

Steps to reproduce
1. Open the attached Test.java in IntelliJ
2. In IntelliJ IDEA, do Reformat Code (CTRL+ALT+L on Windows)
3. Check "Organize Import" and "Rearrange Entries"
4. Click OK

What is the expected output? 

package test;

import static java.lang.System.out;

import java.text.NumberFormat;

public class Test {

    public void test() {
      out.println(NumberFormat.getInstance().format(Math.PI));
    }
}


What do you see instead?

package test;

import java.text.NumberFormat;

import static java.lang.System.out;

public class Test {

    public void test() {
      out.println(NumberFormat.getInstance().format(Math.PI));
    }
}

What version of the product are you using? 

* r134 of intellij-java-google-style.xml
* IntelliJ IDEA 13.03
* JRE 1.7.0_40-b43 x86

On what operating system?
* Windows 7 Enterprise (V 6.1 SP1)

Please provide any additional information below.

I attached the corrected intellij-java-google-style.xml to places the static 
imports first as per the code style.

Original issue reported on code.google.com by [email protected] on 8 Jul 2014 at 5:39

Attachments:

@GoogleCodeExporter
Copy link
Author

I'd like to point out this still hasn't been fixed. Static imports still come 
last.

Original comment by [email protected] on 17 Sep 2014 at 8:32

@GoogleCodeExporter
Copy link
Author

The IntelliJ XML settings file for Google Style seems to have a lot other 
errors as well. Expected: Line width limited to 100 characters. Actual: No 
specification.

This configuration file hasn't been updated since 2011, while the Eclipse file 
has been steadily updated over time. Could we please update this?

Original comment by [email protected] on 11 Feb 2015 at 8:38

@GoogleCodeExporter
Copy link
Author

I second (or 4th) this: we have developers working with IntelliJ and Eclipse 
and it doesn't make sense to have constant reformats because of this 
inconsistency.

Original comment by [email protected] on 26 Mar 2015 at 8:52

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

No branches or pull requests

1 participant