Skip to content

Commit

Permalink
Remove NewlineAtEndOfFile: Justification: The rule incorrectly flag…
Browse files Browse the repository at this point in the history
…s all files as violating this rule, regardless of what they end with.

Remove `Javadoc*`: Justification: Many methods that could be documented are intentionally undocumented because they are not part of the public surface SDK area.
Remove `LineLength`: Justification: The project properties automatically breaks lines longer than 120 characters. Any lines that are longer cannot be broken.
Remove `RightCurly`: Justification: The Azure SDK coding guidelines are to have the right curly on a separate line.
Remove `HiddenField`: Justification: The Azure SDK coding guidelines are that the setter and constructor parameter names match the names of the fields that are being set.
Remove `DesignForExtension`: Justification: None of the SDK classes are intended to be subclassed by end-users, but at the same time we don't want to mark them final and prevent derivation for scenarios like mocking, etc.
Remove `FinalParameters`: Justification: The cost to implement and verify the changes outweighs the benefit here.
Remove `RegexpSingleline`: Justification: Over 5000 hits in generated boilerplate comments. Use Eclipse preference file to auto-remove EOL whitespace in code.

Update preferences to automatically remove trailing whitespace characters in code lines.
Remove the .settings to the .gitignore file, so the preferences can be shared across the team.
Fix the single instance of EOL whitespace in code.
  • Loading branch information
jcookems committed Nov 2, 2012
1 parent aef78f4 commit 66d3af2
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -2,5 +2,3 @@
.project .project
target target
node_modules node_modules
.settings

2 changes: 1 addition & 1 deletion microsoft-azure-api/.settings/org.eclipse.jdt.ui.prefs
Expand Up @@ -30,7 +30,7 @@ cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=tru
cleanup.qualify_static_member_accesses_with_declaring_class=true cleanup.qualify_static_member_accesses_with_declaring_class=true
cleanup.qualify_static_method_accesses_with_declaring_class=false cleanup.qualify_static_method_accesses_with_declaring_class=false
cleanup.remove_private_constructors=true cleanup.remove_private_constructors=true
cleanup.remove_trailing_whitespaces=false cleanup.remove_trailing_whitespaces=true
cleanup.remove_trailing_whitespaces_all=true cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false cleanup.remove_trailing_whitespaces_ignore_empty=false
cleanup.remove_unnecessary_casts=true cleanup.remove_unnecessary_casts=true
Expand Down
49 changes: 48 additions & 1 deletion microsoft-azure-api/src/config/checkstyle.xml
Expand Up @@ -47,7 +47,12 @@


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

<!-- Removed on 11/02/2012
Justification: The rule incorrectly flags all files as violating
this rule, regardless of what they end with.
<module name="NewlineAtEndOfFile"/> <module name="NewlineAtEndOfFile"/>
-->


<!-- Checks that property files contain the same keys. --> <!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation --> <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
Expand All @@ -62,22 +67,33 @@
<property name="eachLine" value="true"/> <property name="eachLine" value="true"/>
</module> </module>


<!-- Removed on 11/02/2012:
Justification: Over 5000 hits in generated boilerplate comments.
Use Eclipse preference file to auto-remove EOL whitespace in code.
<module name="RegexpSingleline"> <module name="RegexpSingleline">
<!-- \s matches whitespace character, $ matches end of line. -->
<property name="format" value="\s+$"/> <property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/> <property name="message" value="Line has trailing spaces."/>
</module> </module>
-->


<module name="TreeWalker"> <module name="TreeWalker">


<property name="cacheFile" value="${checkstyle.cache.file}"/> <property name="cacheFile" value="${checkstyle.cache.file}"/>


<!-- Checks for Javadoc comments. --> <!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html --> <!-- See http://checkstyle.sf.net/config_javadoc.html -->

<!-- Removed on 11/02/2012
Justification: Many methods that could be documented are
intentionally undocumented because they are not part of
the public surface SDK area.
<module name="JavadocMethod"/> <module name="JavadocMethod"/>
<module name="JavadocType"/> <module name="JavadocType"/>
<module name="JavadocVariable"/> <module name="JavadocVariable"/>
<module name="JavadocStyle"/> <module name="JavadocStyle"/>
-->




<!-- Checks for Naming Conventions. --> <!-- Checks for Naming Conventions. -->
Expand Down Expand Up @@ -118,9 +134,15 @@


<!-- Checks for Size Violations. --> <!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html --> <!-- See http://checkstyle.sf.net/config_sizes.html -->

<!-- Removed on 11/02/2012:
Justification: The project properties automatically breaks
lines longer than 120 characters. Any lines that are longer
cannot be broken.
<module name="LineLength"> <module name="LineLength">
<property name="max" value="160" /> <property name="max" value="160" />
</module> </module>
-->
<module name="MethodLength"/> <module name="MethodLength"/>
<module name="ParameterNumber"/> <module name="ParameterNumber"/>


Expand Down Expand Up @@ -150,7 +172,12 @@
<module name="EmptyBlock"/> <module name="EmptyBlock"/>
<module name="LeftCurly"/> <module name="LeftCurly"/>
<module name="NeedBraces"/> <module name="NeedBraces"/>

<!-- Removed on 11/02/2012:
Justification: The Azure SDK coding guidelines
are to have the right curly on a separate line.
<module name="RightCurly"/> <module name="RightCurly"/>
-->




<!-- Checks for common coding problems --> <!-- Checks for common coding problems -->
Expand All @@ -159,7 +186,13 @@
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE --> <module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
<module name="EmptyStatement"/> <module name="EmptyStatement"/>
<module name="EqualsHashCode"/> <module name="EqualsHashCode"/>
<!-- Removed on 11/02/2012:
Justification: The Azure SDK coding guidelines
are that the setter and constructor parameter names match
the names of the fields that are being set.
<module name="HiddenField"/> <module name="HiddenField"/>
-->

<module name="IllegalInstantiation"/> <module name="IllegalInstantiation"/>
<module name="InnerAssignment"/> <module name="InnerAssignment"/>
<module name="MagicNumber"/> <module name="MagicNumber"/>
Expand All @@ -170,7 +203,15 @@


<!-- Checks for class design --> <!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html --> <!-- See http://checkstyle.sf.net/config_design.html -->

<!-- Removed on 11/02/2012:
Justification: None of the SDK classes are intended
to be subclassed by end-users, but at the same time we don't
want to mark them final and prevent derivation for scenarios
like mocking, etc.
<module name="DesignForExtension"/> <module name="DesignForExtension"/>
-->

<module name="FinalClass"/> <module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/> <module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/> <module name="InterfaceIsType"/>
Expand All @@ -180,7 +221,13 @@
<!-- Miscellaneous other checks. --> <!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html --> <!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/> <module name="ArrayTypeStyle"/>

<!-- Removed on 11/02/2012:
Justification: The cost to implement and verify the changes
outweighs the benefit here.
<module name="FinalParameters"/> <module name="FinalParameters"/>
-->

<module name="TodoComment"/> <module name="TodoComment"/>
<module name="UpperEll"/> <module name="UpperEll"/>


Expand Down
Expand Up @@ -468,7 +468,7 @@ public static void setStatus(RoleInstanceStatus status, Date expiration_utc) {


Calendar expiration = Calendar.getInstance(); Calendar expiration = Calendar.getInstance();
expiration.setTime(expiration_utc); expiration.setTime(expiration_utc);

CurrentState newState = new AcquireCurrentState(clientId, currentGoalState.get().getIncarnation(), CurrentState newState = new AcquireCurrentState(clientId, currentGoalState.get().getIncarnation(),
currentStatus, expiration); currentStatus, expiration);


Expand Down

0 comments on commit 66d3af2

Please sign in to comment.