• Home
  • Raw
  • Download

Lines Matching +full:if +full:- +full:no +full:- +full:files +full:- +full:found

21 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 '''This tool lints C++ files and produces a summary of the errors found.
55 If no files are provided on the command-line, all C++ source files are
61 parser.add_argument('files', nargs = '*')
62 parser.add_argument('--jobs', '-j', metavar='N', type=int, nargs='?',
65 help='''Runs the tests using N jobs. If the option is set
66 but no value is provided, the script will use as many jobs
68 parser.add_argument('--no-cache',
84 if process.returncode == 0:
90 if progress_prefix:
95 res = re.search('Total errors found: (\d+)', outerr)
96 if res:
101 n_errors = -1
109 # Run under a try-catch to avoid flooding the output when the script is
119 if filename not in cached_results:
126 # Returns the total number of errors found in the files linted.
129 # If not `None`, `cached_results` is used to avoid re-linting files, and new
131 def LintFiles(files, argument
135 if not IsCppLintAvailable():
138 ("cpplint.py not found. Please ensure the depot"
140 " http://dev.chromium.org/developers/how-tos/install-depot-tools for"
143 return -1
146 files = filter(os.path.isfile, files)
148 # Filter out files for which we have a cached correct result.
149 if cached_results is not None and len(cached_results) != 0:
150 n_input_files = len(files)
151 files = filter(lambda f: ShouldLint(f, cached_results), files)
152 n_skipped_files = n_input_files - len(files)
153 if n_skipped_files != 0:
156 'Skipping %d correct files that were already processed.' %
163 tasks = [(f, progress_prefix) for f in files]
164 # Run under a try-catch to avoid flooding the output when the script is
176 if cached_results is not None:
178 if errors == 0:
186 progress_prefix + 'Total errors found: %d' % n_errors)
198 # lint all C++ files.
208 if os.path.isfile(cached_results_pkl_filename):
219 def FilterOutTestTraceHeaders(files): argument
226 return filter(lambda f: not IsTraceHeader(f), files)
229 def RunLinter(files, jobs=1, progress_prefix='', cached=True): argument
230 results = {} if not cached else ReadCachedResults()
232 rc = LintFiles(files,
241 if __name__ == '__main__':
245 files = args.files or util.get_source_files() variable
248 retcode = RunLinter(files, jobs=args.jobs, cached=cached)