First check ignores then check cache
This gives you the possibility to add a errornous migration to the ignore list. On the seccond run the linter will first use the ignore list and not the cache first.
This commit is contained in:
1 parent
b7c3ee38d7
commit
08dc26085b
1 file changed
+4
-4
@@ -96,15 +96,15 @@ class MigrationLinter(object):
|
|||||||
|
|
||||||
md5hash = self.get_migration_hash(app_label, migration_name)
|
md5hash = self.get_migration_hash(app_label, migration_name)
|
||||||
|
|
||||||
if self.should_use_cache() and md5hash in self.old_cache:
|
|
||||||
self.lint_cached_migration(md5hash)
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.should_ignore_migration(app_label, migration_name):
|
if self.should_ignore_migration(app_label, migration_name):
|
||||||
print("IGNORE")
|
print("IGNORE")
|
||||||
self.nb_ignored += 1
|
self.nb_ignored += 1
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if self.should_use_cache() and md5hash in self.old_cache:
|
||||||
|
self.lint_cached_migration(md5hash)
|
||||||
|
return
|
||||||
|
|
||||||
sql_statements = self.get_sql(app_label, migration_name)
|
sql_statements = self.get_sql(app_label, migration_name)
|
||||||
analysis_result = analyse_sql_statements(sql_statements)
|
analysis_result = analyse_sql_statements(sql_statements)
|
||||||
errors = analysis_result["errors"]
|
errors = analysis_result["errors"]
|
||||||
|
|||||||
Reference in new issue
Block a user