Skip to content

Commit 901657e

Browse files
Ryan P KilbyCarlton Gibson
authored andcommitted
Add banned imports to prevent standard json import
1 parent 8ab75a2 commit 901657e

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

requirements/requirements-codestyle.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# PEP8 code linting, which we run on all commits.
22
flake8==2.4.0
3+
flake8-tidy-imports==1.1.0
34
pep8==1.5.7
45

56
# Sort and lint imports

rest_framework/utils/encoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import datetime
77
import decimal
8-
import json
8+
import json # noqa
99
import uuid
1010

1111
from django.db.models.query import QuerySet

rest_framework/utils/json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from __future__ import absolute_import
33

44
import functools
5-
import json
5+
import json # noqa
66

77

88
def strict_constant(o):

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ license_file = LICENSE.md
66

77
[flake8]
88
ignore = E501
9+
banned-modules = json = use from rest_framework.utils import json!

0 commit comments

Comments
 (0)