github.com/tsuna/gohbase@v0.0.0-20250731002811-4ffcadfba63e/check_line_len.awk (about)

     1  #!/usr/bin/awk -f
     2  
     3  BEGIN {
     4    max = 100;
     5  }
     6  
     7  # Expand tabs to 4 spaces.
     8  {
     9    gsub(/\t/, "    ");
    10  }
    11  
    12  length() > max {
    13    errors++;
    14    print FILENAME ":" FNR ": Line too long (" length() "/" max ")";
    15  }
    16  
    17  END {
    18    if (errors >= 125) {
    19      errors = 125;
    20    }
    21    exit errors;
    22  }