Skip to content

Commit

Permalink
Enable checkstyle to detect incorrect package header
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Dec 2, 2017
1 parent 75ff971 commit 1a40ae5
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Current
-------

### Added:

- [Enable checkstyle to detect incorrect package header](https://github.com/yahoo/fili/pull/594)
* Fili was able to pass the build with wrong package headers in some source files. This needs to be fixed, and it's
fixed in this PR by adding PackageDeclaration checkstyle rule.
* In addition, checkstyle version has been bumped to the latest one(Nov, 2017), which is now able to detect more
styling errors.

- [Add loaded strategy onto tables full view endpoint](https://github.com/yahoo/fili/pull/589)
* Add dimension storage strategy to table full view endpoint

Expand Down
11 changes: 7 additions & 4 deletions checkstyle-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<!-- Make the @SuppressWarnings annotations available to Checkstyle -->
<module name="SuppressWarningsHolder" />

<module name="FileContentsHolder" />

<module name="ConstantName">
<property name="severity" value="error" />
<property name="format" value="^[A-Z][A-Z0-9_]*$" />
Expand Down Expand Up @@ -92,6 +90,11 @@
value="Need braces for all code blocks." />
</module>

<module name="PackageDeclaration">
<property name="severity" value="error"/>
<property name="matchDirectoryStructure" value="true"/>
</module>

<module name="WhitespaceAround">
<property name="severity" value="error" />
<metadata name="net.sf.eclipsecs.core.comment"
Expand Down Expand Up @@ -263,6 +266,8 @@
<property name="tokens" value="VARIABLE_DEF"/>
</module>

<module name="SuppressionCommentFilter"/>

</module>

<module name="RegexpSingleline">
Expand Down Expand Up @@ -293,8 +298,6 @@
<metadata name="net.sf.eclipsecs.core.comment" value="Enforce newline at end of file." />
</module>

<module name="SuppressionCommentFilter"/>

<module name="RegexpMultiline">
<metadata name="net.sf.eclipsecs.core.comment" value="Excessive white space" />
<property name="severity" value="error" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public PaginationMapper(
* @param resultSet The result set to be cut down.
*
* @return The page of results desired.
*
* @throws com.yahoo.bard.webservice.web.PageNotFoundException if the page requested is past the last page of data.
*/
@Override
public ResultSet map(ResultSet resultSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public interface DataRequestHandler {
*/
boolean handleRequest(
RequestContext context,
final DataApiRequest request,
final DruidAggregationQuery<?> druidQuery,
final ResponseProcessor response
DataApiRequest request,
DruidAggregationQuery<?> druidQuery,
ResponseProcessor response
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,5 @@ public Map<String, String> getAdditionalProperties() {
public void setAdditionalProperty(String name, String value) {
this.additionalProperties.put(name, value);
}

}
//CHECKSTYLE:ON
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<checkstyle.skip>false</checkstyle.skip>
<checkstyle.config.location>checkstyle-style.xml</checkstyle.config.location>
<checkstyle.suppressions.location>checkstyle-suppressions.xml</checkstyle.suppressions.location>
<checkstyle.version>6.14.1</checkstyle.version>
<checkstyle.version>8.5</checkstyle.version>
<checkstyle.resourceIncludes>**/*.properties*</checkstyle.resourceIncludes>

<dependency.locations.enabled>false</dependency.locations.enabled>
Expand Down Expand Up @@ -527,6 +527,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<!-- override default checkstyle version -->
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
Expand Down

0 comments on commit 1a40ae5

Please sign in to comment.