mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 01:26:53 +03:00
isort v5 (#7484)
This commit is contained in:
parent
3d708ac700
commit
355afcf64b
|
@ -4,4 +4,4 @@ flake8-tidy-imports==4.1.0
|
|||
pycodestyle==2.5.0
|
||||
|
||||
# Sort and lint imports
|
||||
isort==4.3.21
|
||||
isort==5.4.2
|
||||
|
|
|
@ -96,8 +96,8 @@ except ImportError:
|
|||
|
||||
try:
|
||||
import pygments
|
||||
from pygments.lexers import get_lexer_by_name, TextLexer
|
||||
from pygments.formatters import HtmlFormatter
|
||||
from pygments.lexers import TextLexer, get_lexer_by_name
|
||||
|
||||
def pygments_highlight(text, lang, style):
|
||||
lexer = get_lexer_by_name(lang, stripall=False)
|
||||
|
@ -121,9 +121,10 @@ if markdown is not None and pygments is not None:
|
|||
# starting from this blogpost and modified to support current markdown extensions API
|
||||
# https://zerokspot.com/weblog/2008/06/18/syntax-highlighting-in-markdown-with-pygments/
|
||||
|
||||
from markdown.preprocessors import Preprocessor
|
||||
import re
|
||||
|
||||
from markdown.preprocessors import Preprocessor
|
||||
|
||||
class CodeBlockPreprocessor(Preprocessor):
|
||||
pattern = re.compile(
|
||||
r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M | re.S)
|
||||
|
|
|
@ -11,7 +11,7 @@ PYTEST_ARGS = {
|
|||
|
||||
FLAKE8_ARGS = ['rest_framework', 'tests']
|
||||
|
||||
ISORT_ARGS = ['--recursive', '--check-only', '--diff', 'rest_framework', 'tests']
|
||||
ISORT_ARGS = ['--check-only', '--diff', 'rest_framework', 'tests']
|
||||
|
||||
|
||||
def exit_on_failure(ret, message=None):
|
||||
|
|
|
@ -13,7 +13,7 @@ banned-modules = json = use from rest_framework.utils import json!
|
|||
skip=.tox
|
||||
atomic=true
|
||||
multi_line_output=5
|
||||
known_standard_library=types
|
||||
extra_standard_library=types
|
||||
known_third_party=pytest,_pytest,django,pytz,uritemplate
|
||||
known_first_party=rest_framework,tests
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user