Thanks for the review! Looks like we might get this to land once and for
all :)


http://gwt-code-reviews.appspot.com/1465803/diff/8/build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java
File
build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java
(right):

http://gwt-code-reviews.appspot.com/1465803/diff/8/build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java#newcode2
build-tools/customchecks/src/com/google/gwt/checkstyle/GwtHeaderCheck.java:2:
* Copyright 2011 Google Inc.
On 2011/06/20 17:59:24, zundel wrote:
If we decide to keep the custom check changes, You will also need to
check-in a
pre-build gwt-checkstyle.jar file to be consistent with past
practices.

Already done (Rietveld doesn't show the binary files though)

http://gwt-code-reviews.appspot.com/1465803/diff/8/eclipse/settings/code-style/gwt-checkstyle.xml
File eclipse/settings/code-style/gwt-checkstyle.xml (right):

http://gwt-code-reviews.appspot.com/1465803/diff/8/eclipse/settings/code-style/gwt-checkstyle.xml#newcode85
eclipse/settings/code-style/gwt-checkstyle.xml:85: <property
name="header" value="/\*\n \* Copyright 20(0[6789]|[12][0-9]) Google
Inc\.\n \*[ ]*\n \* Licensed under the Apache License, Version 2\.0
\(the &quot;License&quot;\); you may not\n \* use this file except in
compliance with the License\. You may obtain a copy of\n \* the License
at\n \*[ ]*\n \* http://www\.apache\.org/licenses/LICENSE-2\.0\n \*[
]*\n \* Unless required by applicable law or agreed to in writing,
software\n \* distributed under the License is distributed on an
&quot;AS IS&quot; BASIS, WITHOUT\n \* WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied\. See the\n \* License for the specific
language governing permissions and limitations under\n \* the
License\.\n \*/"/>
On 2011/06/20 17:59:24, zundel wrote:
Instead of coming up with the more complicated check logic, we could
express
this as a regular expression

property name="header" value="/\*\n \* Copyright 20(0[6789]|[12][0-9])
Google
Inc\.\n \*[ ]*\n \* Licensed under the Apache License, Version 2\.0
\(the
&quot;License&quot;\); you may not[\s\*]+use this file except[\s\*]+in
compliance with the License\. You may obtain a copy of[\s\*]+

...

I agree that it would be cleaner, but that wouldn't be as strict as our
current tests. E.g., somebody could get passed a half 80 and half 100
formatted header preamble.

To support both with the same restrictions we currently have, I don't
think there is a simpler way. We could have one enormous regular
expression that slurped up the entire header and accepted either 80 or
100 column headers, but then we wouldn't be able to point to the correct
line number if something didn't match.

http://gwt-code-reviews.appspot.com/1465803/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to