Add PG reindex linting warning and improve some smaller stuff
This commit is contained in:
1 parent
6e15f65467
commit
fa56196f04
4 files changed
+21
-7
No files matched your search
@@ -121,15 +121,14 @@ class BaseAnalyser(object):
|
||||
|
||||
@property
|
||||
def one_line_migration_tests(self):
|
||||
return [test for test in self.migration_tests if test["mode"] == "one_liner"]
|
||||
return (test for test in self.migration_tests if test["mode"] == "one_liner")
|
||||
|
||||
@property
|
||||
def transaction_migration_tests(self):
|
||||
return [test for test in self.migration_tests if test["mode"] == "transaction"]
|
||||
return (test for test in self.migration_tests if test["mode"] == "transaction")
|
||||
|
||||
def _test_sql(self, test, sql):
|
||||
if test["fn"](sql, errors=self.errors):
|
||||
err = self.build_error_dict(migration_test=test, sql_statement=sql)
|
||||
if test["code"] in self.exclude_migration_tests:
|
||||
action = "IGNORED"
|
||||
list_to_add = self.ignored
|
||||
@@ -140,6 +139,7 @@ class BaseAnalyser(object):
|
||||
action = "ERROR"
|
||||
list_to_add = self.errors
|
||||
logger.debug("Testing %s -- %s", sql, action)
|
||||
err = self.build_error_dict(migration_test=test, sql_statement=sql)
|
||||
list_to_add.append(err)
|
||||
else:
|
||||
logger.debug("Testing %s -- PASSED", sql)
|
||||
|
||||
@@ -21,4 +21,11 @@ class PostgresqlAnalyser(BaseAnalyser):
|
||||
"mode": "one_liner",
|
||||
"type": "warning",
|
||||
},
|
||||
{
|
||||
"code": "REINDEX",
|
||||
"fn": lambda sql, **kw: sql.startswith("REINDEX"),
|
||||
"msg": "REINDEX locks table",
|
||||
"mode": "one_liner",
|
||||
"type": "warning",
|
||||
},
|
||||
]
|
||||
Reference in new issue
Block a user