Skip to content

Commit

Permalink
HIVE-1104. Suppress Checkstyle warnings for generated files. (Carl St…
Browse files Browse the repository at this point in the history
…einbach via zshao)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hive/trunk@905512 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
zshao committed Feb 2, 2010
1 parent 1a7818d commit 5db0d8e
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 153 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Trunk - Unreleased
HIVE-1068. CREATE VIEW followup: add a 'table type' enum attribute in
metastore's MTable. (John Sichi via zshao)

HIVE-1104. Suppress Checkstyle warnings for generated files.
(Carl Steinbach via zshao)

OPTIMIZATIONS

BUG FIXES
Expand Down
8 changes: 3 additions & 5 deletions build-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,22 @@
</target>

<target name="ivy-retrieve" depends="ivy-resolve"
description="Retrieve Ivy-managed artifacts" unless="offline">
description="Retrieve Ivy-managed artifacts">
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
log="${ivyresolvelog}"/>
</target>

<target name="ivy-retrieve-checkstyle" depends="ivy-resolve-checkstyle"
description="Retrieve Ivy-managed artifacts for the checkstyle configurations"
unless="offline">
description="Retrieve Ivy-managed artifacts for the checkstyle configurations">
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}"
log="${ivyresolvelog}"/>
<ivy:cachepath pathid="checkstyle-classpath" conf="checkstyle"/>
</target>

<target name="ivy-retrieve-hadoop-source" depends="ivy-init"
description="Retrieve Ivy-managed Hadoop source artifacts"
unless="offline">
description="Retrieve Ivy-managed Hadoop source artifacts">
<ivy:retrieve settingsRef="${ant.project.name}.ivy.settings"
pattern="${build.dir.hadoop}/[artifact]-[revision].[ext]"/>
</target>
Expand Down
21 changes: 11 additions & 10 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -495,16 +495,17 @@

<checkstyle config="${checkstyle.conf.dir}/checkstyle.xml"
failOnViolation="false">
<fileset dir="${hive.root}/cli/src" includes="**/*.java"/>
<fileset dir="${hive.root}/common/src" includes="**/*.java"/>
<fileset dir="${hive.root}/contrib/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/hwi/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/jdbc/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/metastore/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/ql/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/serde/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/service/src/java" includes="**/*.java"/>
<fileset dir="${hive.root}/shims/src" includes="**/*.java"/>
<fileset dir="${hive.root}/ant" includes="**/*.java"/>
<fileset dir="${hive.root}/cli" includes="**/*.java"/>
<fileset dir="${hive.root}/common" includes="**/*.java"/>
<fileset dir="${hive.root}/contrib" includes="**/*.java"/>
<fileset dir="${hive.root}/hwi" includes="**/*.java"/>
<fileset dir="${hive.root}/jdbc" includes="**/*.java"/>
<fileset dir="${hive.root}/metastore" includes="**/*.java"/>
<fileset dir="${hive.root}/ql" includes="**/*.java"/>
<fileset dir="${hive.root}/serde" includes="**/*.java"/>
<fileset dir="${hive.root}/service" includes="**/*.java"/>
<fileset dir="${hive.root}/shims" includes="**/*.java"/>
<formatter type="xml" toFile="${checkstyle.build.dir}/checkstyle-errors.xml"/>
</checkstyle>

Expand Down
17 changes: 17 additions & 0 deletions checkstyle/asf.header
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
294 changes: 157 additions & 137 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!--
Checkstyle configuration for Hadoop that is based on the sun_checks.xml file
Checkstyle configuration for Hive that is based on the sun_checks.xml file
that is bundled with Checkstyle and includes checks for:
- the Java Language Specification at
Expand Down Expand Up @@ -50,141 +50,161 @@

<module name="Checker">

<!-- Checks that a package.html file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
<module name="PackageHtml"/>

<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!-- module name="NewlineAtEndOfFile"/-->

<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>


<module name="TreeWalker">

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
</module>
<module name="JavadocStyle"/>

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>


<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- </module> -->

<!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/> -->


<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>


<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>
<module name="LineLength">
<property name="max" value="100"/>
<property name="ignorePattern" value="^ *\* *[^ ]+$"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber"/>


<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="TabCharacter"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI"/>
</module>


<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>


<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>


<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- module name="AvoidInlineConditionals"/-->
<module name="DoubleCheckedLocking"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>

<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>


<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="Indentation">
<property name="basicOffset" value="2" />
<property name="caseIndent" value="0" />
</module>
<module name="TodoComment"/>
<module name="UpperEll"/>

<!-- Checks that a package.html file exists for each package. -->
<module name="JavadocPackage"/>

<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile"/>

<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>

<module name="Header">
<property name="headerFile" value="${basedir}/checkstyle/asf.header"/>
</module>

<!-- Maximum file line length -->
<module name="FileLength">
<property name="max" value="2000"/>
</module>

<!-- No TAB characters -->
<module name="FileTabCharacter"/>

<!-- List of files to ignore -->
<module name="SuppressionFilter">
<property name="file" value="${basedir}/checkstyle/suppressions.xml"/>
</module>

<!-- Ignore JavaCC/JJTree files -->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat"
value=".*Generated By:(JJTree|JavaCC).*"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="100000"/>
</module>

<!-- Ignore Thrift files -->
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat"
value=".*Autogenerated by Thrift.*"/>
<property name="checkFormat" value=".*"/>
<property name="influenceFormat" value="100000"/>
</module>



<module name="TreeWalker">

<!-- Required for SuppressWithNearbyCommentFilter -->
<module name="FileContentsHolder"/>

<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
</module>

<module name="JavadocStyle"/>

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>

<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="AvoidStarImport"/>


<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="100"/>
<property name="ignorePattern" value="^ *\* *[^ ]+$"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber"/>


<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter">
<property name="tokens" value="COMMA, SEMI"/>
</module>


<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>


<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>


<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<!-- module name="AvoidInlineConditionals"/-->
<module name="DoubleCheckedLocking"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="HiddenField">
<!-- Check local variables. Ignore parameters -->
<property name="tokens" value="VARIABLE_DEF"/>
</module>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="MissingOverride"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>

<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier"/>


<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="Indentation">
<property name="basicOffset" value="2" />
<property name="caseIndent" value="0" />
</module>
<module name="TodoComment"/>
<module name="UpperEll"/>

</module>

</module>
Loading

0 comments on commit 5db0d8e

Please sign in to comment.