Skip to content

Commit

Permalink
Enable svn keyword substitution on some more files.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@484 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
julianhyde committed Jan 5, 2012
1 parent 0f9cbf1 commit 03c5c60
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 15 deletions.
2 changes: 1 addition & 1 deletion buildOnJdk.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
rem $Id: //open/mondrian/buildOnJdk.bat#2 $
rem $Id$
rem
rem Licensed to Julian Hyde under one or more contributor license
rem agreements. See the NOTICE file distributed with this work for
Expand Down
2 changes: 1 addition & 1 deletion buildOnJdk.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: //open/mondrian/buildOnJdk.sh#2 $
# $Id$
#
# Licensed to Julian Hyde under one or more contributor license
# agreements. See the NOTICE file distributed with this work for
Expand Down
45 changes: 36 additions & 9 deletions checkFile.awk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function _matchFile(fname) {
|| fname ~ "/fennel/" \
|| fname ~ "/extensions/" \
|| fname ~ "/com/sqlstream/" \
|| !lenient;
|| strict > 0;
}
function _isCpp(fname) {
return fname ~ /\.(cpp|h)$/;
Expand Down Expand Up @@ -109,7 +109,7 @@ BEGIN {
quot = sprintf("%c", 34);
lf = sprintf("%c", 13);
pattern = apos "(\\" apos "|[^" apos "])" apos;
if (0) printf "maxLineLength=%s lenient=%s\n", maxLineLength, lenient;
if (0) printf "maxLineLength=%s strict=%s\n", maxLineLength, strict;
}
FNR == 1 {
if (fname) {
Expand Down Expand Up @@ -229,7 +229,6 @@ FNR == 1 {
thisImport = $2;
gsub(/;/, "", thisImport);
gsub(/\*/, "", thisImport);
importGroup = "zzzzzzzzzzzzzzzzz";
if (thisPackage ~ /^mondrian.*/ && thisImport ~ /^mondrian.*/ \
|| thisPackage ~ /^org.olap4j.*/ && thisImport ~ /^org.olap4j.*/)
{
Expand Down Expand Up @@ -257,7 +256,7 @@ FNR == 1 {
if (!previousLineWasEmpty) {
error(fname, FNR, "Expected blank line between import groups");
} else if (prevImportGroup > importGroup) {
error(fname, FNR, "Import group out of sequence" importGroup prevImportGroup);
error(fname, FNR, "Import group out of sequence (should precede " prevImportGroup ")");
}
} else if (prevImport \
&& prevImport > thisImport \
Expand All @@ -269,6 +268,34 @@ FNR == 1 {
prevImport = thisImport;
prevImportGroup = importGroup;
}
/^\/\/ Copyright .* Julian/ && strict {
if ($0 !~ /-2012/) {
error(fname, FNR, "copyright is not current");
}
}
/(static|public|private|protected|final|abstract)/ && !/import/ && strict > 1 {
# Order of qualifiers: "public/private/protected static final abstract class ..."
s2 = s;
gsub(/\(.*$/, "", s2);
if (s2 ~ /abstract .*final/) {
error(fname, FNR, "'final' must come before 'abstract'");
}
if (s2 ~ /final .*static/) {
error(fname, FNR, "'static' must come before 'final'");
}
if (s2 ~ /abstract .*static/) {
error(fname, FNR, "'static' must come before 'abstract'");
}
if (s2 ~ /static .*(public|protected|private)/) {
error(fname, FNR, "'public/private/protected' must come before 'static'");
}
if (s2 ~ /final .*(public|protected|private)/) {
error(fname, FNR, "'public/private/protected' must come before 'final'");
}
if (s2 ~ /abstract .*(public|protected|private)/) {
error(fname, FNR, "'public/private/protected' must come before 'abstract'");
}
}
/^$/ {
if (matchFile && previousLineEndedInOpenBrace) {
error(fname, FNR, "Empty line following open brace");
Expand Down Expand Up @@ -504,7 +531,7 @@ match(s, /([]A-Za-z0-9() ] *)(+|-|\*|\^|\/|%|=|==|+=|-=|\*=|\/=|>=|<=|!=|&|&&|\|
else if (a[2] == "&" && isCpp && s ~ /&[^ ]/) {} # ignore case "foo(&x)" in c++
else if (isCpp && s ~ /\<operator[^ ]+\(/) {} # ignore e.g. "operator++()" in c++
else if (isCpp && a[2] == "/" && s ~ /#include/) {} # ignore e.g. "#include <x/y.hpp>" in c++
else if (lenient && fname ~ /(fennel)/ && a[1] = ",") {} # not enabled yet
else if (strict < 2 && fname ~ /(fennel)/ && a[1] = ",") {} # not enabled yet
else {
error(fname, FNR, "operator '" a[2] "' must be followed by space");
}
Expand All @@ -518,8 +545,8 @@ match(s, /( )(,)/, a) {
}
match(s, / (+|-|\*|\/|==|>=|<=|!=|<<|<<<|>>|&|&&|\|\||\?|:)$/, a) || \
match(s, /(\.|->)$/, a) {
if (lenient && fname ~ /(aspen)/ && a[1] != ":") {} # not enabled yet
else if (lenient && fname ~ /(fennel|farrago|aspen)/ && a[1] = "+") {} # not enabled yet
if (strict < 2 && fname ~ /(aspen)/ && a[1] != ":") {} # not enabled yet
else if (strict < 2 && fname ~ /(fennel|farrago|aspen)/ && a[1] = "+") {} # not enabled yet
else if (a[1] == ":" && s ~ /(case.*|default):$/) {
# ignore e.g. "case 5:"
} else if ((a[1] == "*" || a[1] == "&") && isCpp && s ~ /^[[:alnum:]:_ ]* [*&]$/) {
Expand Down Expand Up @@ -623,7 +650,7 @@ s ~ /{/ {
gsub(/[^(]/, "", opens);
closes = s;
gsub(/[^)]/, "", closes);
if (0 && lenient && fname ~ /aspen/) {} # not enabled
if (0 && strict < 2 && fname ~ /aspen/) {} # not enabled
else if (length(closes) > length(opens)) {
error(fname, FNR, "Open brace should be on new line (function call/decl spans several lines)");
}
Expand Down Expand Up @@ -694,7 +721,7 @@ length($0) > maxLineLength \
if (funDeclStartLine < FNR \
&& $0 !~ /^ *{$/)
{
if (lenient && fname ~ /aspen/) {} # not enabled
if (strict < 2 && fname ~ /aspen/) {} # not enabled
else error(fname, FNR, "Open brace should be on new line (function decl spans several lines)");
}
funDeclStartLine = 0;
Expand Down
4 changes: 3 additions & 1 deletion checkFile.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# $Id: //open/mondrian-release/3.2/bin/checkFile.sh#2 $
# $Id$
#
# Licensed to Julian Hyde under one or more contributor license
# agreements. See the NOTICE file distributed with this work for
Expand Down Expand Up @@ -44,6 +44,8 @@ usage() {
echo "--lenient"
echo " Does not apply rules to components which are not known to"
echo " be in compliance. The perforce trigger uses this option."
echo "--strict"
echo " Stricter than usual; the opposite of lenient."
}

doCheck() {
Expand Down
4 changes: 2 additions & 2 deletions src/org/olap4j/query/LevelSelectionImpl.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
// $Id: LevelSelectionImpl.java 399 2011-02-03 20:53:50Z pstoellberger $
// $Id$
//
// Licensed to Julian Hyde under one or more contributor license
// agreements. See the NOTICE file distributed with this work for
Expand Down Expand Up @@ -28,7 +28,7 @@
* Abstract implementation of {@link Selection}.
*
* @author pstoellberger
* @version $Id: LevelSelectionImpl.java 454 2011-05-15 20:53:50Z pstoellberger $
* @version $Id$
* @since Feb 3, 2011
*/
class LevelSelectionImpl extends AbstractSelection {
Expand Down
2 changes: 1 addition & 1 deletion subfloor.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--===========================================================================
/*
// $Id: subfloor.xml $
// $Id$
//
// Licensed to Julian Hyde under one or more contributor license
// agreements. See the NOTICE file distributed with this work for
Expand Down

0 comments on commit 03c5c60

Please sign in to comment.