chore: Upgrade Python syntax with pyupgrade

Run with the following pre-commit configuration:

```
repos:
  - repo: https://github.com/asottile/pyupgrade
    rev: v3.1.0
    hooks:
      - id: pyupgrade
        args: [ "--py3-plus", "--py36-plus", "--py37-plus" ]
```

The rationale for every change can be found at https://github.com/asottile/pyupgrade
This commit is contained in:
Sondre Lillebø Gundersen authored and David Wobrock committed 2022-11-03 22:00:00 +01:00
1 parent 92eab3c929
commit bd4eb89b8c
29 files changed
+32 -65

No files matched your search

+2 -2
View File
@@ -36,13 +36,13 @@ def has_add_unique(sql_statements, **kwargs):
concerned_table = regex_result.group(1)
table_is_added_in_transaction = any(
sql.startswith("CREATE TABLE {}".format(concerned_table))
sql.startswith(f"CREATE TABLE {concerned_table}")
for sql in sql_statements
)
return not table_is_added_in_transaction
class BaseAnalyser(object):
class BaseAnalyser:
base_migration_tests = [
{
"code": "RENAME_TABLE",
@@ -16,7 +16,7 @@ def has_create_index(sql_statements, **kwargs):
concerned_table = regex_result.group(2)
table_is_added_in_transaction = any(
sql.startswith("CREATE TABLE {}".format(concerned_table))
sql.startswith(f"CREATE TABLE {concerned_table}")
for sql in sql_statements
)
return not table_is_added_in_transaction