mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
use flake8 to lint for a few things black doesn't catch
black does *not* warn about missing or extraneous imports, so let's bring back flake8 in our linting to check for them
This commit is contained in:
@@ -375,7 +375,7 @@ def events_table(since, full_path, until, **kwargs):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return _copy_table(table='events', query=query("main_jobevent.event_data::json"), path=full_path)
|
return _copy_table(table='events', query=query("main_jobevent.event_data::json"), path=full_path)
|
||||||
except UntranslatableCharacter as exc:
|
except UntranslatableCharacter:
|
||||||
return _copy_table(table='events', query=query("replace(main_jobevent.event_data::text, '\\u0000', '')::json"), path=full_path)
|
return _copy_table(table='events', query=query("replace(main_jobevent.event_data::text, '\\u0000', '')::json"), path=full_path)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from prometheus_client import PROCESS_COLLECTOR, PLATFORM_COLLECTOR, GC_COLLECTOR, CollectorRegistry, Gauge, Info, generate_latest
|
from prometheus_client import CollectorRegistry, Gauge, Info, generate_latest
|
||||||
|
|
||||||
from awx.conf.license import get_license
|
from awx.conf.license import get_license
|
||||||
from awx.main.utils import get_awx_version
|
from awx.main.utils import get_awx_version
|
||||||
|
|||||||
@@ -2,12 +2,8 @@
|
|||||||
# Python
|
# Python
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
# Django
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.migrations import ActivityStreamDisabledMigration
|
from awx.main.migrations import ActivityStreamDisabledMigration
|
||||||
import awx.main.fields
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(ActivityStreamDisabledMigration):
|
class Migration(ActivityStreamDisabledMigration):
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
# AWX
|
|
||||||
from awx.main.migrations import _migration_utils as migration_utils
|
|
||||||
from awx.main.migrations import _credentialtypes as credentialtypes
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
from awx.main.migrations import ActivityStreamDisabledMigration
|
from awx.main.migrations import ActivityStreamDisabledMigration
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.migrations import _migration_utils as migration_utils
|
from awx.main.migrations import _migration_utils as migration_utils
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
# Generated by Django 1.11.7 on 2017-12-11 16:40
|
# Generated by Django 1.11.7 on 2017-12-11 16:40
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import awx.main.fields
|
import awx.main.fields
|
||||||
from django.conf import settings
|
from django.db import migrations
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
# Generated by Django 1.11.7 on 2018-02-27 17:58
|
# Generated by Django 1.11.7 on 2018-02-27 17:58
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import awx.main.fields
|
from django.db import migrations
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
# TODO: Squash all of these migrations with '0024_v330_add_oauth_activity_stream_registrar'
|
# TODO: Squash all of these migrations with '0024_v330_add_oauth_activity_stream_registrar'
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
|
|||||||
# AWX
|
# AWX
|
||||||
from awx.main.migrations import _credentialtypes as credentialtypes
|
from awx.main.migrations import _credentialtypes as credentialtypes
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
# Generated by Django 1.11.11 on 2018-03-16 20:25
|
# Generated by Django 1.11.11 on 2018-03-16 20:25
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import awx.main.fields
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import awx.main.fields
|
import awx.main.fields
|
||||||
import awx.main.models.activity_stream
|
import awx.main.models.activity_stream
|
||||||
from django.conf import settings
|
from django.db import migrations
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
# Generated by Django 1.11.11 on 2018-05-23 20:17
|
# Generated by Django 1.11.11 on 2018-05-23 20:17
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import awx.main.fields
|
|
||||||
from django.conf import settings
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Generated by Django 1.11.20 on 2019-05-06 15:20
|
# Generated by Django 1.11.20 on 2019-05-06 15:20
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations
|
||||||
from awx.main.fields import OrderedManyToManyField
|
from awx.main.fields import OrderedManyToManyField
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
import awx
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import django.db.models.deletion
|
|||||||
|
|
||||||
from awx.main.migrations._rbac import (
|
from awx.main.migrations._rbac import (
|
||||||
rebuild_role_parentage,
|
rebuild_role_parentage,
|
||||||
rebuild_role_hierarchy,
|
|
||||||
migrate_ujt_organization,
|
migrate_ujt_organization,
|
||||||
migrate_ujt_organization_backward,
|
migrate_ujt_organization_backward,
|
||||||
restore_inventory_admins,
|
restore_inventory_admins,
|
||||||
|
|||||||
@@ -3,15 +3,11 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import awx.main.fields
|
import awx.main.fields
|
||||||
from awx.main.utils.encryption import encrypt_field, decrypt_field
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
from django.utils.timezone import now
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
from awx.main.migrations import _galaxy as galaxy
|
from awx.main.migrations import _galaxy as galaxy
|
||||||
from awx.main.models import CredentialType as ModernCredentialType
|
|
||||||
from awx.main.utils.common import set_current_apps
|
|
||||||
|
|
||||||
logger = logging.getLogger('awx.main.migrations')
|
logger = logging.getLogger('awx.main.migrations')
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import random
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.utils.timezone import now
|
||||||
from django.utils.timezone import now, timedelta
|
|
||||||
|
|
||||||
logger = logging.getLogger('awx.main.migrations')
|
logger = logging.getLogger('awx.main.migrations')
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from uuid import uuid4
|
|
||||||
|
|
||||||
from django.utils.encoding import smart_text
|
from django.utils.encoding import smart_text
|
||||||
from django.utils.timezone import now
|
|
||||||
|
|
||||||
from awx.main.utils.common import set_current_apps
|
from awx.main.utils.common import set_current_apps
|
||||||
from awx.main.utils.common import parse_yaml_or_json
|
from awx.main.utils.common import parse_yaml_or_json
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import collections
|
import collections
|
||||||
import time
|
|
||||||
import logging
|
import logging
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import yaml
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
|
||||||
import stat
|
import stat
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import threading
|
import threading
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import re
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
# Tower
|
# Tower
|
||||||
from awx.conf import fields, register
|
from awx.conf import fields
|
||||||
|
|
||||||
|
|
||||||
class PendoTrackingStateField(fields.ChoiceField):
|
class PendoTrackingStateField(fields.ChoiceField):
|
||||||
|
|||||||
2
tox.ini
2
tox.ini
@@ -2,10 +2,12 @@
|
|||||||
deps =
|
deps =
|
||||||
make
|
make
|
||||||
black
|
black
|
||||||
|
flake8
|
||||||
yamllint
|
yamllint
|
||||||
allowlist_externals = make
|
allowlist_externals = make
|
||||||
setenv =
|
setenv =
|
||||||
BLACK_ARGS = --check
|
BLACK_ARGS = --check
|
||||||
commands =
|
commands =
|
||||||
make black
|
make black
|
||||||
|
flake8 awx --select=F401,F402,F821,F823,F841
|
||||||
yamllint -s .
|
yamllint -s .
|
||||||
|
|||||||
Reference in New Issue
Block a user