From 108a4c2e00f6a662f7e40336216efe7f35504f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Pe=C3=B1a?= Date: Sat, 27 Feb 2021 00:22:48 -0500 Subject: [PATCH] More linter corrections --- .../management/commands/unmigrate.py | 21 +++++++++++++---- dunm_sandbox/myapp/migrations/0001_initial.py | 9 ++++---- .../myapp/migrations/0003_mymodel_is_paid.py | 6 ++--- dunm_sandbox/settings.py | 23 +++++++++++++++---- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/django_unmigrate/management/commands/unmigrate.py b/django_unmigrate/management/commands/unmigrate.py index 11504d9..32aa47e 100644 --- a/django_unmigrate/management/commands/unmigrate.py +++ b/django_unmigrate/management/commands/unmigrate.py @@ -14,7 +14,10 @@ class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( - "ref", nargs="?", default=MAIN_BRANCH, help="Git ref to compare existing migrations.", + "ref", + nargs="?", + default=MAIN_BRANCH, + help="Git ref to compare existing migrations.", ) parser.add_argument( "--database", @@ -22,16 +25,24 @@ def add_arguments(self, parser): help='Nominates a database to synchronize. Defaults to the "default" database.', ) parser.add_argument( - "--fake", action="store_true", help="Mark migrations as run without actually running them.", + "--fake", + action="store_true", + help="Mark migrations as run without actually running them.", ) parser.add_argument( - "--dry-run", action="store_true", help="Just print the target migrations.", + "--dry-run", + action="store_true", + help="Just print the target migrations.", ) parser.add_argument( - "--danger", action="store_true", help="Ignore DEBUG=False and run the command anyways.", + "--danger", + action="store_true", + help="Ignore DEBUG=False and run the command anyways.", ) parser.add_argument( - "--clean", action="store_true", help="Delete migration files after they get unmigrated.", + "--clean", + action="store_true", + help="Delete migration files after they get unmigrated.", ) def run_from_argv(self, argv): # pragma: no cover diff --git a/dunm_sandbox/myapp/migrations/0001_initial.py b/dunm_sandbox/myapp/migrations/0001_initial.py index 266acc5..59263a3 100644 --- a/dunm_sandbox/myapp/migrations/0001_initial.py +++ b/dunm_sandbox/myapp/migrations/0001_initial.py @@ -7,15 +7,14 @@ class Migration(migrations.Migration): initial = True - dependencies = [ - ] + dependencies = [] operations = [ migrations.CreateModel( - name='MyModel', + name="MyModel", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(blank=True, max_length=30)), + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("name", models.CharField(blank=True, max_length=30)), ], ), ] diff --git a/dunm_sandbox/myapp/migrations/0003_mymodel_is_paid.py b/dunm_sandbox/myapp/migrations/0003_mymodel_is_paid.py index 540f76b..f6b2be6 100644 --- a/dunm_sandbox/myapp/migrations/0003_mymodel_is_paid.py +++ b/dunm_sandbox/myapp/migrations/0003_mymodel_is_paid.py @@ -6,13 +6,13 @@ class Migration(migrations.Migration): dependencies = [ - ('myapp', '0002_mymodel_tz_created'), + ("myapp", "0002_mymodel_tz_created"), ] operations = [ migrations.AddField( - model_name='mymodel', - name='is_paid', + model_name="mymodel", + name="is_paid", field=models.BooleanField(default=False), ), ] diff --git a/dunm_sandbox/settings.py b/dunm_sandbox/settings.py index ea48919..c9ead5c 100644 --- a/dunm_sandbox/settings.py +++ b/dunm_sandbox/settings.py @@ -73,17 +73,30 @@ # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases -DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3"),}} +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": os.path.join(BASE_DIR, "db.sqlite3"), + } +} # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ - {"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",}, - {"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",}, - {"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",}, - {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",}, + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, ]