Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
ExternalRepo
flake8
提交
55ea9fec
提交
55ea9fec
编辑于
6年前
作者:
Ian Stapleton Cordasco
浏览文件
操作
下载
差异文件
Merge branch 'latest_pycodestyle' into 'master'
Latest pycodestyle See merge request pycqa/flake8!287
上级
532ea9cc
50e7cc71
main
pre-commit-ci-update-config
remove-statistics-count-benchmarks
7.0.0
6.1.0
6.0.0
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0
4.0.1
4.0.0
3.9.2
3.9.1
3.9.0
3.8.4
3.8.3
3.8.2
3.8.1
3.8.0
3.8.0a2
3.8.0a1
3.7.9
3.7.8
3.7.7
3.7.6
3.7.5
3.7.4
3.7.3
3.7.2
3.7.1
3.7.0
无相关合并请求
变更
7
Hide whitespace changes
Inline
Side-by-side
显示
7 个更改的文件
docs/source/plugin-development/plugin-parameters.rst
+1
-0
docs/source/plugin-development/plugin-parameters.rst
setup.cfg
+2
-2
setup.cfg
setup.py
+2
-1
setup.py
src/flake8/main/options.py
+11
-0
src/flake8/main/options.py
src/flake8/processor.py
+3
-0
src/flake8/processor.py
tests/unit/test_checker_manager.py
+1
-1
tests/unit/test_checker_manager.py
tests/unit/test_file_processor.py
+1
-0
tests/unit/test_file_processor.py
有
21 个添加
和
4 个删除
+21
-4
docs/source/plugin-development/plugin-parameters.rst
+
1
-
0
浏览文件 @
55ea9fec
...
...
@@ -48,6 +48,7 @@ the data instead of being called on each physical or logical line.
- :attr:`~flake8.processor.FileProcessor.file_tokens`
- :attr:`~flake8.processor.FileProcessor.lines`
- :attr:`~flake8.processor.FileProcessor.max_line_length`
- :attr:`~flake8.processor.FileProcessor.max_doc_length`
- :attr:`~flake8.processor.FileProcessor.total_lines`
- :attr:`~flake8.processor.FileProcessor.verbose`
...
...
This diff is collapsed.
Click to expand it.
setup.cfg
+
2
-
2
浏览文件 @
55ea9fec
...
...
@@ -14,6 +14,6 @@ requires-dist =
enum34; python_version<"3.4"
typing; python_version<"3.5"
configparser; python_version<"3.2"
pyflakes >= 2.
0
.0, < 2.
1
.0
pycodestyle >= 2.
4
.0, < 2.
5
.0
pyflakes >= 2.
1
.0, < 2.
2
.0
pycodestyle >= 2.
5
.0, < 2.
6
.0
mccabe >= 0.6.0, < 0.7.0
This diff is collapsed.
Click to expand it.
setup.py
+
2
-
1
浏览文件 @
55ea9fec
...
...
@@ -21,7 +21,7 @@ requires = [
# http://flake8.pycqa.org/en/latest/internal/releases.html#releasing-flake8
"entrypoints >= 0.2.3, < 0.3.0"
,
"pyflakes >= 2.1.0, < 2.2.0"
,
"pycodestyle >= 2.
4
.0, < 2.
5
.0"
,
"pycodestyle >= 2.
5
.0, < 2.
6
.0"
,
"mccabe >= 0.6.0, < 0.7.0"
,
]
...
...
@@ -115,6 +115,7 @@ setuptools.setup(
PEP8_PLUGIN
(
'comparison_type'
),
PEP8_PLUGIN
(
'ambiguous_identifier'
),
PEP8_PLUGIN
(
'bare_except'
),
PEP8_PLUGIN
(
'maximum_doc_length'
),
PEP8_PLUGIN
(
'python_3000_has_key'
),
PEP8_PLUGIN
(
'python_3000_raise_comma'
),
PEP8_PLUGIN
(
'python_3000_not_equal'
),
...
...
This diff is collapsed.
Click to expand it.
src/flake8/main/options.py
+
11
-
0
浏览文件 @
55ea9fec
...
...
@@ -21,6 +21,7 @@ def register_default_options(option_manager):
- ``--extend-ignore``
- ``--per-file-ignores``
- ``--max-line-length``
- ``--max-doc-length``
- ``--select``
- ``--disable-noqa``
- ``--show-source``
...
...
@@ -164,6 +165,16 @@ def register_default_options(option_manager):
"(Default: %default)"
,
)
add_option
(
"--max-doc-length"
,
type
=
"int"
,
metavar
=
"n"
,
default
=
None
,
parse_from_config
=
True
,
help
=
"Maximum allowed doc line length for the entirety of this run. "
"(Default: %default)"
,
)
add_option
(
"--select"
,
metavar
=
"errors"
,
...
...
This diff is collapsed.
Click to expand it.
src/flake8/processor.py
+
3
-
0
浏览文件 @
55ea9fec
...
...
@@ -35,6 +35,7 @@ class FileProcessor(object):
- :attr:`line_number`
- :attr:`logical_line`
- :attr:`max_line_length`
- :attr:`max_doc_length`
- :attr:`multiline`
- :attr:`noqa`
- :attr:`previous_indent_level`
...
...
@@ -80,6 +81,8 @@ class FileProcessor(object):
self
.
logical_line
=
""
#: Maximum line length as configured by the user
self
.
max_line_length
=
options
.
max_line_length
#: Maximum docstring / comment line length as configured by the user
self
.
max_doc_length
=
options
.
max_doc_length
#: Whether the current physical line is multiline
self
.
multiline
=
False
#: Whether or not we're observing NoQA
...
...
This diff is collapsed.
Click to expand it.
tests/unit/test_checker_manager.py
+
1
-
1
浏览文件 @
55ea9fec
...
...
@@ -23,7 +23,7 @@ def test_oserrors_cause_serial_fall_back():
with
mock
.
patch
(
'_multiprocessing.SemLock'
,
side_effect
=
err
):
manager
=
checker
.
Manager
(
style_guide
,
[],
[])
with
mock
.
patch
.
object
(
manager
,
'run_serial'
)
as
serial
:
manager
.
run
()
manager
.
run
()
assert
serial
.
call_count
==
1
assert
manager
.
using_multiprocessing
is
False
...
...
This diff is collapsed.
Click to expand it.
tests/unit/test_file_processor.py
+
1
-
0
浏览文件 @
55ea9fec
...
...
@@ -13,6 +13,7 @@ def options_from(**kwargs):
"""Generate a Values instances with our kwargs."""
kwargs
.
setdefault
(
'hang_closing'
,
True
)
kwargs
.
setdefault
(
'max_line_length'
,
79
)
kwargs
.
setdefault
(
'max_doc_length'
,
None
)
kwargs
.
setdefault
(
'verbose'
,
False
)
kwargs
.
setdefault
(
'stdin_display_name'
,
'stdin'
)
return
optparse
.
Values
(
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段