From 6e0ec5b65c05d704327f7960e0b5a0c0190f58a9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 May 2019 20:32:09 +0530 Subject: [PATCH] Get an accurate count for how many files are left that need unicode porting 555 left currently, sigh. --- setup/port.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup/port.py b/setup/port.py index ef81146ac7..0a7ccc2e8f 100644 --- a/setup/port.py +++ b/setup/port.py @@ -56,6 +56,8 @@ def run_2to3(path, show_diffs=False): class Base(Command): + scan_all_files = False + @property def cache_file(self): return self.j(build_cache_dir(), self.CACHE) @@ -89,6 +91,14 @@ class Base(Command): raise dirty_files = tuple(f for f in self.get_files() if not self.is_cache_valid(f, cache)) try: + if self.scan_all_files: + bad_files = [] + for f in dirty_files: + if self.file_has_errors(f): + bad_files.append(f) + else: + cache[f] = self.file_hash(f) + dirty_files = bad_files for i, f in enumerate(dirty_files): num_left = len(dirty_files) - i - 1 self.info('\tChecking', f) @@ -141,6 +151,7 @@ class UnicodeCheck(Base): description = 'Check for unicode porting status' CACHE = 'check_unicode.json' + scan_all_files = True def get_error_statement(self, f): uni_pat = re.compile(r'from __future__ import .*\bunicode_literals\b')