Add method to linter reset_counters
This commit is contained in:
1 parent
a9cae8a21e
commit
8a7cff3c82
1 file changed
+8
-5
@@ -72,11 +72,7 @@ class MigrationLinter(object):
|
|||||||
self.warnings_as_errors = warnings_as_errors
|
self.warnings_as_errors = warnings_as_errors
|
||||||
|
|
||||||
# Initialise counters
|
# Initialise counters
|
||||||
self.nb_valid = 0
|
self.reset_counters()
|
||||||
self.nb_ignored = 0
|
|
||||||
self.nb_warnings = 0
|
|
||||||
self.nb_erroneous = 0
|
|
||||||
self.nb_total = 0
|
|
||||||
|
|
||||||
# Initialise cache. Read from old, write to new to prune old entries.
|
# Initialise cache. Read from old, write to new to prune old entries.
|
||||||
if self.should_use_cache():
|
if self.should_use_cache():
|
||||||
@@ -91,6 +87,13 @@ class MigrationLinter(object):
|
|||||||
connection=connections[self.database], load=True
|
connection=connections[self.database], load=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def reset_counters(self):
|
||||||
|
self.nb_valid = 0
|
||||||
|
self.nb_ignored = 0
|
||||||
|
self.nb_warnings = 0
|
||||||
|
self.nb_erroneous = 0
|
||||||
|
self.nb_total = 0
|
||||||
|
|
||||||
def should_use_cache(self):
|
def should_use_cache(self):
|
||||||
return self.django_path and not self.no_cache
|
return self.django_path and not self.no_cache
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user