Changeset 4549 for trunk/utils


Ignore:
Timestamp:
10/23/08 14:27:26 (12 years ago)
Author:
curtis
Message:

Add hack to exclude LOCI source code URLs from long line reporting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/LineLength.java

    r1151 r4549  
    1616  private static final int TABWIDTH = 2; 
    1717 
     18  private static final String[] LOCI_HACKS = { 
     19    " * <dd><a href=\"https://skyking.microscopy.wisc.edu/trac/", 
     20    " * <a href=\"https://skyking.microscopy.wisc.edu/svn/java/trunk/" 
     21  }; 
     22 
    1823  public static void main(String[] args) throws IOException { 
    1924    int tabWidth = TABWIDTH; 
    2025    boolean checkTabs = true, checkEndSpaces = true; 
     26    boolean lociHacks = false; 
    2127    Vector v = new Vector(); 
    2228    for (int i=0; i<args.length; i++) { 
     
    3238        else if (args[i].equals("-notabs")) checkTabs = false; 
    3339        else if (args[i].equals("-noendspaces")) checkEndSpaces = false; 
     40        else if (args[i].equals("-locihacks")) lociHacks = true; 
    3441        else System.out.println("Unknown flag: " + args[i]); 
    3542        continue; 
     
    7077        int len = line.length(); 
    7178        boolean tooLong = len > LENGTH; 
     79        if (lociHacks) { 
     80          for (int j=0; j<LOCI_HACKS.length; j++) { 
     81            if (line.startsWith(LOCI_HACKS[j])) { 
     82              tooLong = false; 
     83              break; 
     84            } 
     85          } 
     86        } 
    7287        boolean endSpace = checkEndSpaces && 
    7388          len > 0 && line.charAt(len - 1) == ' '; 
Note: See TracChangeset for help on using the changeset viewer.