mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-14 05:36:50 +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
|
pycodestyle==2.5.0
|
||||||
|
|
||||||
# Sort and lint imports
|
# Sort and lint imports
|
||||||
isort==4.3.21
|
isort==5.4.2
|
||||||
|
|
|
@ -96,8 +96,8 @@ except ImportError:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pygments
|
import pygments
|
||||||
from pygments.lexers import get_lexer_by_name, TextLexer
|
|
||||||
from pygments.formatters import HtmlFormatter
|
from pygments.formatters import HtmlFormatter
|
||||||
|
from pygments.lexers import TextLexer, get_lexer_by_name
|
||||||
|
|
||||||
def pygments_highlight(text, lang, style):
|
def pygments_highlight(text, lang, style):
|
||||||
lexer = get_lexer_by_name(lang, stripall=False)
|
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
|
# 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/
|
# https://zerokspot.com/weblog/2008/06/18/syntax-highlighting-in-markdown-with-pygments/
|
||||||
|
|
||||||
from markdown.preprocessors import Preprocessor
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from markdown.preprocessors import Preprocessor
|
||||||
|
|
||||||
class CodeBlockPreprocessor(Preprocessor):
|
class CodeBlockPreprocessor(Preprocessor):
|
||||||
pattern = re.compile(
|
pattern = re.compile(
|
||||||
r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M | re.S)
|
r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M | re.S)
|
||||||
|
|
|
@ -11,7 +11,7 @@ PYTEST_ARGS = {
|
||||||
|
|
||||||
FLAKE8_ARGS = ['rest_framework', 'tests']
|
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):
|
def exit_on_failure(ret, message=None):
|
||||||
|
|
|
@ -13,7 +13,7 @@ banned-modules = json = use from rest_framework.utils import json!
|
||||||
skip=.tox
|
skip=.tox
|
||||||
atomic=true
|
atomic=true
|
||||||
multi_line_output=5
|
multi_line_output=5
|
||||||
known_standard_library=types
|
extra_standard_library=types
|
||||||
known_third_party=pytest,_pytest,django,pytz,uritemplate
|
known_third_party=pytest,_pytest,django,pytz,uritemplate
|
||||||
known_first_party=rest_framework,tests
|
known_first_party=rest_framework,tests
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user