changeset 20153:96acaee06302

added Checkstyle rule to prevent non-ASCII characters in Java source files
author Doug Simon <doug.simon@oracle.com>
date Fri, 03 Apr 2015 10:41:57 +0200
parents cfd1c99206b9
children 5b2fd4cd7b8f
files graal/com.oracle.graal.graph/.checkstyle_checks.xml graal/com.oracle.truffle.api/.checkstyle_checks.xml
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/.checkstyle_checks.xml	Fri Apr 03 10:41:28 2015 +0200
+++ b/graal/com.oracle.graal.graph/.checkstyle_checks.xml	Fri Apr 03 10:41:57 2015 +0200
@@ -21,9 +21,7 @@
     <module name="MemberName">
       <property name="format" value="^(([a-z][a-zA-Z0-9]*$)|(_[A-Z][a-zA-Z0-9]*_[a-z][a-zA-Z0-9]*$))"/>
     </module>
-    <module name="MethodName">
-      <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
-    </module>
+    <module name="MethodName"/>
     <module name="PackageName"/>
     <module name="ParameterName"/>
     <module name="TypeName">
@@ -126,9 +124,13 @@
       <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Illegal whitespace before a comma."/>
     </module>
     <module name="RegexpSinglelineJava">
+      <property name="format" value="[^\x00-\x7F]"/>
+      <property name="message" value="Only use ASCII characters."/>
+    </module>
+    <module name="RegexpSinglelineJava">
       <property name="format" value="new (Hashtable|Vector|Stack|StringBuffer)[^\w]"/>
       <property name="message" value="Don't use old synchronized collection classes"/>
-    </module>    
+    </module>
   </module>
   <module name="RegexpHeader">
     <property name="header" value="/\*\n \* Copyright \(c\) (20[0-9][0-9], )?20[0-9][0-9], Oracle and/or its affiliates. All rights reserved.\n \* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n \*\n \* This code is free software; you can redistribute it and/or modify it\n \* under the terms of the GNU General Public License version 2 only, as\n \* published by the Free Software Foundation.\n \*\n \* This code is distributed in the hope that it will be useful, but WITHOUT\n \* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n \* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\n \* version 2 for more details \(a copy is included in the LICENSE file that\n \* accompanied this code\).\n \*\n \* You should have received a copy of the GNU General Public License version\n \* 2 along with this work; if not, write to the Free Software Foundation,\n \* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n \*\n \* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n \* or visit www.oracle.com if you need additional information or have any\n \* questions.\n \*/\n"/>
--- a/graal/com.oracle.truffle.api/.checkstyle_checks.xml	Fri Apr 03 10:41:28 2015 +0200
+++ b/graal/com.oracle.truffle.api/.checkstyle_checks.xml	Fri Apr 03 10:41:57 2015 +0200
@@ -126,6 +126,10 @@
       <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Illegal whitespace before a comma."/>
     </module>
     <module name="RegexpSinglelineJava">
+      <property name="format" value="[^\x00-\x7F]"/>
+      <property name="message" value="Only use ASCII characters."/>
+    </module>
+     <module name="RegexpSinglelineJava">
       <property name="format" value="new (Hashtable|Vector|Stack|StringBuffer)[^\w]"/>
       <property name="message" value="Don't use old synchronized collection classes"/>
     </module>