contrib/check-code.py
changeset 11816 e1359ad582f6
parent 11764 16723af520b0
child 11886 73112cb2a6d7
equal deleted inserted replaced
11815:20a88cf7ee92 11816:e1359ad582f6
     5 # Copyright 2010 Matt Mackall <mpm@selenic.com>
     5 # Copyright 2010 Matt Mackall <mpm@selenic.com>
     6 #
     6 #
     7 # This software may be used and distributed according to the terms of the
     7 # This software may be used and distributed according to the terms of the
     8 # GNU General Public License version 2 or any later version.
     8 # GNU General Public License version 2 or any later version.
     9 
     9 
    10 import re, glob, os
    10 import re, glob, os, sys
    11 import optparse
    11 import optparse
    12 
    12 
    13 def repquote(m):
    13 def repquote(m):
    14     t = re.sub(r"\w", "x", m.group('text'))
    14     t = re.sub(r"\w", "x", m.group('text'))
    15     t = re.sub(r"[^\sx]", "o", t)
    15     t = re.sub(r"[^\sx]", "o", t)
   259         check = glob.glob("*")
   259         check = glob.glob("*")
   260     else:
   260     else:
   261         check = args
   261         check = args
   262 
   262 
   263     for f in check:
   263     for f in check:
   264         checkfile(f, maxerr=options.per_file, warnings=options.warnings,
   264         ret = 0
   265                   blame=options.blame)
   265         if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,
       
   266                          blame=options.blame):
       
   267             ret = 1
       
   268     sys.exit(ret)