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

fix: cleanup checkstyle import rules #1503

Merged
merged 2 commits into from Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions checkstyle.xml
Expand Up @@ -52,6 +52,15 @@ page at http://checkstyle.sourceforge.net/config.html -->
<property name="severity" value="error"/>
</module>

<module name="ImportOrder">
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure, but perhaps what really needs to be updated is this:

https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml

Why do we have to customize this in this project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"@elharo The customization was needed because we do not have formatter plugin enabled in this repository. Due to that import order are not structured properly.

I am planning to enable the formatter plugin after that we would not have to customize this configuration.

I will open a separate PR for that once that is merged will rebase this PR."

<property name="severity" value="warning"/>
<!-- This ensures that static imports go first. -->
<property name="option" value="top"/>
<property name="separatedStaticGroups" value="true"/>
<property name="caseSensitive" value="true"/>
<property name="tokens" value="STATIC_IMPORT, IMPORT"/>
</module>

<!--

JAVADOC CHECKS
Expand Down
Expand Up @@ -15,7 +15,6 @@
import com.google.android.gms.auth.GoogleAuthException;
import com.google.api.client.util.Beta;
import com.google.api.client.util.Preconditions;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -27,7 +27,6 @@
import com.google.appengine.api.appidentity.AppIdentityService;
import com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult;
import com.google.appengine.api.appidentity.AppIdentityServiceFactory;

import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
Expand Down
Expand Up @@ -18,9 +18,7 @@
import com.google.api.client.googleapis.extensions.servlet.notifications.WebhookUtils;
import com.google.api.client.util.Beta;
import com.google.api.client.util.store.DataStoreFactory;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.google.appengine.api.appidentity.AppIdentityService;
import com.google.appengine.api.appidentity.AppIdentityServiceFailureException;
import com.google.appengine.api.appidentity.PublicCertificate;

import java.util.Collection;
import java.util.Date;

Expand Down
Expand Up @@ -16,7 +16,6 @@

import com.google.api.client.extensions.java6.auth.oauth2.AbstractPromptReceiver;
import com.google.api.client.googleapis.auth.oauth2.GoogleOAuthConstants;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -22,7 +22,6 @@
import com.google.api.client.http.protobuf.ProtoHttpContent;
import com.google.api.client.util.Beta;
import com.google.protobuf.MessageLite;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -17,7 +17,6 @@
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest;
import com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer;
import com.google.api.client.util.Beta;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -19,9 +19,7 @@
import com.google.api.client.util.store.DataStore;
import com.google.api.client.util.store.DataStoreFactory;
import com.google.api.client.util.store.MemoryDataStoreFactory;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
Expand Down
Expand Up @@ -23,13 +23,11 @@
import com.google.api.client.util.StringUtils;
import com.google.api.client.util.store.DataStore;
import com.google.api.client.util.store.DataStoreFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
Expand Down
Expand Up @@ -21,7 +21,6 @@
import com.google.api.client.util.FieldInfo;
import com.google.api.client.util.GenericData;
import com.google.api.client.util.Types;

import java.util.Collection;
import java.util.Map;
import java.util.TreeSet;
Expand Down
Expand Up @@ -20,7 +20,6 @@
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.UrlEncodedContent;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -16,7 +16,6 @@

import com.google.api.client.googleapis.GoogleUtils;
import com.google.api.client.http.apache.ApacheHttpTransport;

import com.google.api.client.util.SslUtils;
import java.io.IOException;
import java.net.ProxySelector;
Expand Down
Expand Up @@ -23,7 +23,6 @@
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.util.Beta;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
Expand Down
Expand Up @@ -32,7 +32,6 @@
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.store.DataStore;
import com.google.api.client.util.store.DataStoreFactory;

import java.io.IOException;
import java.util.Collection;

Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.google.api.client.auth.oauth2.AuthorizationCodeResponseUrl;
import com.google.api.client.util.Key;
import com.google.api.client.util.Preconditions;

import java.util.Collection;

/**
Expand Down
Expand Up @@ -24,7 +24,6 @@
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.util.Collection;

Expand Down
Expand Up @@ -17,7 +17,6 @@
import com.google.api.client.auth.oauth2.BrowserClientRequestUrl;
import com.google.api.client.util.Key;
import com.google.api.client.util.Preconditions;

import java.util.Collection;

/**
Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.google.api.client.json.JsonFactory;
import com.google.api.client.util.Key;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.io.Reader;
import java.util.List;
Expand Down
Expand Up @@ -41,7 +41,6 @@
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.SecurityUtils;
import com.google.api.client.util.store.DataStoreFactory;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
Expand Down
Expand Up @@ -19,7 +19,6 @@
import com.google.api.client.json.webtoken.JsonWebSignature;
import com.google.api.client.util.Beta;
import com.google.api.client.util.Key;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.List;
Expand Down
Expand Up @@ -21,7 +21,6 @@
import com.google.api.client.util.Beta;
import com.google.api.client.util.Clock;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.PublicKey;
Expand Down
Expand Up @@ -23,7 +23,6 @@
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;

import java.io.IOException;
import java.util.Collection;

Expand Down
Expand Up @@ -19,7 +19,6 @@
import com.google.api.client.util.Beta;
import com.google.api.client.util.Key;
import com.google.api.client.util.Preconditions;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -20,7 +20,6 @@
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.util.Beta;

import java.io.IOException;
import java.net.SocketTimeoutException;
import java.nio.charset.Charset;
Expand Down
Expand Up @@ -15,7 +15,6 @@
package com.google.api.client.googleapis.batch;

import com.google.api.client.http.HttpHeaders;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -27,7 +27,6 @@
import com.google.api.client.http.MultipartContent;
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.Sleeper;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
Expand Down
Expand Up @@ -26,7 +26,6 @@
import com.google.api.client.http.LowLevelHttpRequest;
import com.google.api.client.http.LowLevelHttpResponse;
import com.google.api.client.util.ByteStreams;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.google.api.client.googleapis.json.GoogleJsonError;
import com.google.api.client.googleapis.json.GoogleJsonErrorContainer;
import com.google.api.client.http.HttpHeaders;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -29,7 +29,6 @@
import com.google.api.client.util.Beta;
import com.google.api.client.util.Clock;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.util.Collection;

Expand Down
Expand Up @@ -16,7 +16,6 @@

import com.google.api.client.googleapis.GoogleUtils;
import com.google.api.client.http.javanet.NetHttpTransport;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
Expand Down
Expand Up @@ -21,7 +21,6 @@
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.util.Data;
import com.google.api.client.util.Key;

import java.io.IOException;
import java.util.Collections;
import java.util.List;
Expand Down
Expand Up @@ -24,7 +24,6 @@
import com.google.api.client.json.JsonToken;
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.StringUtils;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -36,7 +36,6 @@
import com.google.api.client.util.ByteStreams;
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.Sleeper;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down
Expand Up @@ -20,7 +20,6 @@
import com.google.api.client.http.HttpUnsuccessfulResponseHandler;
import com.google.api.client.util.Beta;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down
Expand Up @@ -19,7 +19,6 @@
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.store.DataStore;
import com.google.api.client.util.store.DataStoreFactory;

import java.io.IOException;
import java.io.Serializable;
import java.util.concurrent.locks.Lock;
Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.google.api.client.util.Beta;
import com.google.api.client.util.ObjectParser;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.nio.charset.Charset;

Expand Down
Expand Up @@ -15,7 +15,6 @@
package com.google.api.client.googleapis.notifications;

import com.google.api.client.util.Beta;

import java.io.InputStream;

/**
Expand Down
Expand Up @@ -15,7 +15,6 @@
package com.google.api.client.googleapis.notifications;

import com.google.api.client.util.Beta;

import java.io.IOException;
import java.io.Serializable;

Expand Down
Expand Up @@ -18,7 +18,6 @@
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.util.Beta;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -37,7 +37,6 @@
import com.google.api.client.http.UriTemplate;
import com.google.api.client.util.GenericData;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down
Expand Up @@ -20,7 +20,6 @@
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;

import java.util.Arrays;
import java.util.Collections;

Expand Down
Expand Up @@ -23,7 +23,6 @@
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.UriTemplate;
import com.google.api.client.http.json.JsonHttpContent;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -16,7 +16,6 @@

import com.google.api.client.googleapis.services.AbstractGoogleClientRequest;
import com.google.api.client.googleapis.services.CommonGoogleClientRequestInitializer;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -16,7 +16,6 @@

import com.google.common.base.Splitter;
import com.google.common.collect.Lists;

import java.io.IOException;
import java.net.URLDecoder;
import java.util.HashMap;
Expand Down
Expand Up @@ -12,7 +12,6 @@
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.api.client.util.Beta;
import com.google.api.client.util.Clock;

import java.io.IOException;

/**
Expand Down
Expand Up @@ -27,7 +27,6 @@
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.api.client.util.Beta;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
Expand Down