Skip to content

Commit

Permalink
remove usage of import * and enforce F405 in our linter
Browse files Browse the repository at this point in the history
import * is a scourge upon the earth
  • Loading branch information
ryanpetrello committed Feb 13, 2019
1 parent 295afa8 commit 9bebf32
Show file tree
Hide file tree
Showing 24 changed files with 983 additions and 848 deletions.
12 changes: 10 additions & 2 deletions awx/api/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@

# AWX
from awx.api.filters import FieldLookupBackend
from awx.main.models import * # noqa
from awx.main.models import (
UnifiedJob, UnifiedJobTemplate, User, Role
)
from awx.main.access import access_registry
from awx.main.utils import * # noqa
from awx.main.utils import (
camelcase_to_underscore,
get_search_fields,
getattrd,
get_object_or_400,
decrypt_field
)
from awx.main.utils.db import get_all_field_names
from awx.api.serializers import ResourceAccessListElementSerializer, CopySerializer, UserSerializer
from awx.api.versioning import URLPathVersioning, get_request_version
Expand Down
4 changes: 2 additions & 2 deletions awx/api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from rest_framework import permissions

# AWX
from awx.main.access import * # noqa
from awx.main.models import * # noqa
from awx.main.access import check_user_access
from awx.main.models import Inventory, UnifiedJob
from awx.main.utils import get_object_or_400

logger = logging.getLogger('awx.api.permissions')
Expand Down
18 changes: 16 additions & 2 deletions awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,22 @@
ACTIVE_STATES,
CENSOR_VALUE,
)
from awx.main.models import * # noqa
from awx.main.models.base import NEW_JOB_TYPE_CHOICES
from awx.main.models import (
ActivityStream, AdHocCommand, AdHocCommandEvent, Credential,
CredentialType, CustomInventoryScript, Fact, Group, Host, Instance,
InstanceGroup, Inventory, InventorySource, InventoryUpdate,
InventoryUpdateEvent, Job, JobEvent, JobHostSummary, JobLaunchConfig,
JobTemplate, Label, Notification, NotificationTemplate, OAuth2AccessToken,
OAuth2Application, Organization, Project, ProjectUpdate,
ProjectUpdateEvent, RefreshToken, Role, Schedule, SystemJob,
SystemJobEvent, SystemJobTemplate, Team, UnifiedJob, UnifiedJobTemplate,
UserSessionMembership, V1Credential, WorkflowJob, WorkflowJobNode,
WorkflowJobTemplate, WorkflowJobTemplateNode, StdoutMaxBytesExceeded
)
from awx.main.models.base import VERBOSITY_CHOICES, NEW_JOB_TYPE_CHOICES
from awx.main.models.rbac import (
get_roles_on_resource, role_summary_fields_generator
)
from awx.main.fields import ImplicitRoleField, JSONBField
from awx.main.utils import (
get_type_for_model, get_model_for_type, timestamp_apiformat,
Expand Down
Loading

0 comments on commit 9bebf32

Please sign in to comment.