tholo / pytest-flake8 Goto Github PK
View Code? Open in Web Editor NEWpytest plugin to run flake8
License: Other
pytest plugin to run flake8
License: Other
I'm trying to run pytest-flake8
's tests but get an error:
============================= test session starts ==============================
platform linux -- Python 3.6.6, pytest-3.6.3, py-1.5.4, pluggy-0.6.0
rootdir: /build/pytest-flake8-1.0.1, inifile: tox.ini
plugins: flake8-1.0.1
collected 15 items
pytest_flake8.py F [ 6%]
setup.py . [ 13%]
test_flake8.py ...........x. [100%]
=================================== FAILURES ===================================
_________________________________ FLAKE8-check _________________________________
/build/pytest-flake8-1.0.1/pytest_flake8.py:140:10: W605 invalid escape sequence '\d'
/build/pytest-flake8-1.0.1/pytest_flake8.py:140:12: W605 invalid escape sequence '\d'
/build/pytest-flake8-1.0.1/pytest_flake8.py:140:14: W605 invalid escape sequence '\d'
================ 1 failed, 13 passed, 1 xfailed in 5.88 seconds ================
I'm trying to run pytest inside a docker container that has a readonly filesystem. This means I cannot enable pytest's cacheprovider
plugin. Still, I'd like to be able to use pytest-flake8.
I'm trying:
py.test --flake8 -p no:cacheprovider
The result is:
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/main.py", line 92, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/config.py", line 859, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 750, in call_historic
INTERNALERROR> self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python3.5/site-packages/pytest_flake8.py", line 54, in pytest_configure
INTERNALERROR> config._flake8mtimes = config.cache.get(HISTKEY, {})
INTERNALERROR> AttributeError: 'Config' object has no attribute 'cache'
Could pytest-flake8
's usage of the cacheprovider
plugin be made optional?
I had a project that was pinned to pycqa/flake8 master. When I ran the tests recently, they started failing with this error:
.tox/python/lib/python3.7/site-packages/pluggy/hooks.py:284: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
.tox/python/lib/python3.7/site-packages/pluggy/manager.py:68: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
.tox/python/lib/python3.7/site-packages/pluggy/manager.py:62: in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
.tox/python/lib/python3.7/site-packages/_pytest/runner.py:123: in pytest_runtest_call
item.runtest()
.tox/python/lib/python3.7/site-packages/pytest_flake8.py:117: in runtest
self.statistics)
.tox/python/lib/python3.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
.tox/python/lib/python3.7/site-packages/pytest_flake8.py:190: in check_file
app.make_notifier()
E AttributeError: 'Application' object has no attribute 'make_notifier'
Removing the dependency on master and allowing the pytest-flake8
dependency to designate flake8 corrected the issue.
But I wanted to report this issue here in case I've stumbled on a bug that might emerge with the next release of flake8. Feel free to investigate or close as you see fit.
as reported in pytest-dev/pytest#2455 the plugin needs to register its marker to keep pytest --strict
working
It would be nice if there was a way to detect unnecessary flake8-ignore entries, i.e., which are not actually suppressing any error. The rationale is that some projects will start by adding a lot of entries to flake8-ignore (e.g. because they have a lot of older code which does not follow PEP8, and they mostly want the new code to follow PEP8), but sometimes some files will get cleaned, making some flake8-ignore entries obsolete. If the entries remain, nothing prevents the code from becoming "PEP8-dirty" again, so it would be preferable to keep flake8-ignore up to date instead.
Glob patterns and ALL may be trickier to get right, but even a version where they are not handled would be appreciated.
I guess a way to implement this would be to call flake8 with no ignore flags, do the filtering yourself in a post-processing step, and notify (if requested) of the unnecessary ignores.
According to the docs, flake8 can handle different locations of configuration: setup.cfg, tox.ini, or .flake8.
Sadly these config files are not considered by pytest-flake8 for some reason. Is there a reason or could this be fixed?
If it read the default locations, it would be possible to configure flake8 in one place and use that configuration for both cli invocation and via pytest.
pytest supports py26, but flake8 v3 does not.
A nice way to handle this is for pytest-flake8 to support flake8 v2 while py26 is supported by pytest, or most pytest projects have had enough time to implement v3 without regressions (many flake8 plugins are broken in v3.)
platform linux -- Python 3.5.5, pytest-3.5.0, py-1.5.3, flake8-1.0.0,
[flake8]
max-line-length = 120
exclude=.git,__pycache__,vendor
[tool:pytest]
flake8-exclude=.git,__pycache__,vendor
when running pytest --flake8 with config above, my vendor-package is not excluded.
these settings do not seem to have any effect.
Current versions and recent past versions of pytest-flake8 and flake8 produce different results. Specific inconsistencies around E126 pop up often. Current errors can be reproduced with pytest-flake8 version 1.0.7, pytest version 6.2.4 and flake8 version 3.9.2.
It would be nice to keep PyPI releases and git tags in sync :)
Currently pytest-flake8
will ignore/override the standard [flake8] ignore section even if flake8-ignore is not present within the [tool:pytest] section. The default behavior should be to honor the settings in the [flake8] section within setup.cfg
or tox.ini
.
The following class will pass flake8
, but is marked as error E704
with pytest-flake8
:
class Foo:
default_bar: str
So, maybe it would be helpful if someone else would help with issues and pull requests (to start with, at any rate)... Might provide a bit more timely changes on and off.
So... Volunteers?
Recently pytest-flake8
plugin started to produce very verbose output. And I can switch it off.
Here's the repo to reproduce this bug: https://github.com/wemake-services/wemake-django-template
Versions:
flake8==3.5.0
flake8-blind-except==0.1.1
flake8-bugbear==17.4.0
flake8-builtins==1.0.post0
flake8-commas==0.4.3
flake8-comprehensions==1.4.1
flake8-docstrings==1.1.0
flake8-pep3101==1.1
flake8-polyfill==1.0.1
flake8-quotes==0.12.1
py==1.5.2
pycodestyle==2.3.1
pydocstyle==2.1.1
pyflakes==1.6.0
pytest==3.3.1
pytest-cache==1.0
pytest-cov==2.5.1
pytest-django==3.1.2
pytest-flake8==0.9.1
pytest-forked==0.2
pytest-isort==0.1.0
pytest-xdist==1.20.1
I use python3.6
. 3.6.2
is the most recent one.
pipenv install --dev
pytest
Here it is:
» pytest
============================= test session starts ==============================
platform darwin -- Python 3.6.2, pytest-3.3.1, py-1.5.2, pluggy-0.6.0
Django settings: server.settings (from ini file)
rootdir: /Users/sobolev/Desktop/test_project, inifile: setup.cfg
plugins: xdist-1.20.1, isort-0.1.0, forked-0.2, flake8-0.9.1, django-3.1.2, cov-2.5.1
collected 24 items
manage.py . [ 4%]
types_test.py . [ 8%]
server/__init__.py . [ 12%]
server/urls.py . [ 16%]
server/wsgi.py . [ 20%]
server/main_app/__init__.py . [ 25%]
server/main_app/admin.py . [ 29%]
server/main_app/apps.py . [ 33%]
server/main_app/models.py . [ 37%]
server/main_app/urls.py . [ 41%]
server/main_app/views.py F [ 45%]
server/main_app/tests/__init__.py . [ 50%]
server/main_app/tests/test_views.py .. [ 58%]
server/settings/__init__.py . [ 62%]
server/settings/components/__init__.py . [ 66%]
server/settings/components/common.py . [ 70%]
server/settings/components/csp.py . [ 75%]
server/settings/components/logging.py . [ 79%]
server/settings/environments/__init__.py . [ 83%]
server/settings/environments/development.py . [ 87%]
server/settings/environments/local.py . [ 91%]
server/settings/environments/production.py . [ 95%]
server/settings/environments/testing.py . [100%]
=================================== FAILURES ===================================
____________________ FLAKE8-check(ignoring D100 D104 D401) _____________________
/Users/sobolev/Desktop/test_project/server/main_app/views.py:8:1: D103 Missing docstring in public function
----------------------------- Captured stderr call -----------------------------
processor.py 248 WARNING Plugin requested optional parameter "builtins" but this is not an available parameter.
processor.py 248 WARNING Plugin requested optional parameter "visitor" but this is not an available parameter.
------------------------------ Captured log call -------------------------------
manager.py 210 DEBUG Registered option "Option(-v, --verbose, action=count, default=0, dest=verbose, type=None, callback=None, help=Print more information about what is happening in flake8. This option is repeatable and will increase verbosity each time it is repeated., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(-q, --quiet, action=count, default=0, dest=quiet, type=None, callback=None, help=Report only file names, or nothing. This option is repeatable., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --count, action=store_true, default=None, dest=count, type=None, callback=None, help=Print total number of errors and warnings to standard error and set the exit code to 1 if total is not empty., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --diff, action=store_true, default=None, dest=diff, type=None, callback=None, help=Report changes only within line number ranges in the unified diff provided on standard in by the user., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --exclude, action=None, default=.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg, dest=exclude, type=None, callback=None, help=Comma-separated list of files or directories to exclude. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=patterns)".
manager.py 210 DEBUG Registered option "Option(None, --filename, action=None, default=*.py, dest=filename, type=None, callback=None, help=Only check for filenames matching the patterns in this comma-separated list. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=patterns)".
manager.py 210 DEBUG Registered option "Option(None, --stdin-display-name, action=None, default=stdin, dest=stdin_display_name, type=None, callback=None, help=The name used when reporting errors from code passed via stdin. This is useful for editors piping the file contents to flake8. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --format, action=None, default=default, dest=format, type=None, callback=None, help=Format errors according to the chosen formatter., callback=None, callback_args=None, callback_kwargs=None, metavar=format)".
manager.py 210 DEBUG Registered option "Option(None, --hang-closing, action=store_true, default=None, dest=hang_closing, type=None, callback=None, help=Hang closing bracket instead of matching indentation of opening bracket's line., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --ignore, action=None, default=E121,E123,E126,E226,E24,E704,W503,W504, dest=ignore, type=None, callback=None, help=Comma-separated list of errors and warnings to ignore (or skip). For example, ``--ignore=E4,E51,W234``. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=errors)".
manager.py 210 DEBUG Registered option "Option(None, --max-line-length, action=None, default=79, dest=max_line_length, type=int, callback=None, help=Maximum allowed line length for the entirety of this run. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=n)".
manager.py 210 DEBUG Registered option "Option(None, --select, action=None, default=E,F,W,C90, dest=select, type=None, callback=None, help=Comma-separated list of errors and warnings to enable. For example, ``--select=E4,E51,W234``. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=errors)".
manager.py 210 DEBUG Registered option "Option(None, --disable-noqa, action=store_true, default=False, dest=disable_noqa, type=None, callback=None, help=Disable the effect of "# noqa". This will report errors on lines with "# noqa" at the end., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --show-source, action=store_true, default=None, dest=show_source, type=None, callback=None, help=Show the source generate each error or warning., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --statistics, action=store_true, default=None, dest=statistics, type=None, callback=None, help=Count errors and warnings., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --enable-extensions, action=None, default=, dest=enable_extensions, type=string, callback=None, help=Enable plugins and extensions that are otherwise disabled by default, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --exit-zero, action=store_true, default=None, dest=exit_zero, type=None, callback=None, help=Exit with status code "0" even if there are errors., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --install-hook, action=callback, default=None, dest=install_hook, type=choice, callback=<function install at 0x10b3a0b70>, help=Install a hook that is run prior to a commit for the supported version control system., callback=<function install at 0x10b3a0b70>, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(-j, --jobs, action=None, default=auto, dest=jobs, type=string, callback=None, help=Number of subprocesses to use to run checks in parallel. This is ignored on Windows. The default, "auto", will auto-detect the number of processors available to use. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --output-file, action=None, default=None, dest=output_file, type=string, callback=None, help=Redirect report to a file., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --tee, action=store_true, default=False, dest=tee, type=None, callback=None, help=Write to stdout and output-file., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --append-config, action=append, default=None, dest=append_config, type=None, callback=None, help=Provide extra config files to parse in addition to the files found by Flake8 by default. These files are the last ones read and so they take the highest precedence when multiple files provide the same option., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --config, action=None, default=None, dest=config, type=None, callback=None, help=Path to the config file that will be the authoritative config source. This will cause Flake8 to ignore all other configuration files., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --isolated, action=store_true, default=False, dest=isolated, type=None, callback=None, help=Ignore all found configuration files., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --benchmark, action=store_true, default=False, dest=benchmark, type=None, callback=None, help=Print benchmark information about this run of Flake8, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --bug-report, action=callback, default=None, dest=bug_report, type=None, callback=<function print_information at 0x10b2c1c80>, help=Print information necessary when preparing a bug report, callback=<function print_information at 0x10b2c1c80>, callback_args=None, callback_kwargs={'option_manager': <flake8.options.manager.OptionManager object at 0x10cc48160>}, metavar=None)".
config.py 128 DEBUG Found local configuration files: ['/Users/sobolev/Desktop/test_project/setup.cfg']
manager.py 272 INFO Loading entry-points for "flake8.extension".
manager.py 287 DEBUG Loaded Plugin(name="R70", entry_point="R70 = radon.complexity:Flake8Checker") for plugin "R70".
manager.py 287 DEBUG Loaded Plugin(name="N8", entry_point="N8 = pep8ext_naming:NamingChecker") for plugin "N8".
manager.py 287 DEBUG Loaded Plugin(name="C90", entry_point="C90 = mccabe:McCabeChecker") for plugin "C90".
manager.py 287 DEBUG Loaded Plugin(name="F", entry_point="F = flake8.plugins.pyflakes:FlakesChecker") for plugin "F".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.ambiguous_identifier", entry_point="pycodestyle.ambiguous_identifier = pycodestyle:ambiguous_identifier") for plugin "pycodestyle.ambiguous_identifier".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.bare_except", entry_point="pycodestyle.bare_except = pycodestyle:bare_except") for plugin "pycodestyle.bare_except".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.blank_lines", entry_point="pycodestyle.blank_lines = pycodestyle:blank_lines") for plugin "pycodestyle.blank_lines".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.break_around_binary_operator", entry_point="pycodestyle.break_around_binary_operator = pycodestyle:break_around_binary_operator") for plugin "pycodestyle.break_around_binary_operator".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.comparison_negative", entry_point="pycodestyle.comparison_negative = pycodestyle:comparison_negative") for plugin "pycodestyle.comparison_negative".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.comparison_to_singleton", entry_point="pycodestyle.comparison_to_singleton = pycodestyle:comparison_to_singleton") for plugin "pycodestyle.comparison_to_singleton".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.comparison_type", entry_point="pycodestyle.comparison_type = pycodestyle:comparison_type") for plugin "pycodestyle.comparison_type".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.compound_statements", entry_point="pycodestyle.compound_statements = pycodestyle:compound_statements") for plugin "pycodestyle.compound_statements".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.continued_indentation", entry_point="pycodestyle.continued_indentation = pycodestyle:continued_indentation") for plugin "pycodestyle.continued_indentation".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.explicit_line_join", entry_point="pycodestyle.explicit_line_join = pycodestyle:explicit_line_join") for plugin "pycodestyle.explicit_line_join".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.extraneous_whitespace", entry_point="pycodestyle.extraneous_whitespace = pycodestyle:extraneous_whitespace") for plugin "pycodestyle.extraneous_whitespace".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.imports_on_separate_lines", entry_point="pycodestyle.imports_on_separate_lines = pycodestyle:imports_on_separate_lines") for plugin "pycodestyle.imports_on_separate_lines".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.indentation", entry_point="pycodestyle.indentation = pycodestyle:indentation") for plugin "pycodestyle.indentation".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.maximum_line_length", entry_point="pycodestyle.maximum_line_length = pycodestyle:maximum_line_length") for plugin "pycodestyle.maximum_line_length".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.missing_whitespace", entry_point="pycodestyle.missing_whitespace = pycodestyle:missing_whitespace") for plugin "pycodestyle.missing_whitespace".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.missing_whitespace_after_import_keyword", entry_point="pycodestyle.missing_whitespace_after_import_keyword = pycodestyle:missing_whitespace_after_import_keyword") for plugin "pycodestyle.missing_whitespace_after_import_keyword".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.missing_whitespace_around_operator", entry_point="pycodestyle.missing_whitespace_around_operator = pycodestyle:missing_whitespace_around_operator") for plugin "pycodestyle.missing_whitespace_around_operator".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.module_imports_on_top_of_file", entry_point="pycodestyle.module_imports_on_top_of_file = pycodestyle:module_imports_on_top_of_file") for plugin "pycodestyle.module_imports_on_top_of_file".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.python_3000_backticks", entry_point="pycodestyle.python_3000_backticks = pycodestyle:python_3000_backticks") for plugin "pycodestyle.python_3000_backticks".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.python_3000_has_key", entry_point="pycodestyle.python_3000_has_key = pycodestyle:python_3000_has_key") for plugin "pycodestyle.python_3000_has_key".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.python_3000_not_equal", entry_point="pycodestyle.python_3000_not_equal = pycodestyle:python_3000_not_equal") for plugin "pycodestyle.python_3000_not_equal".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.python_3000_raise_comma", entry_point="pycodestyle.python_3000_raise_comma = pycodestyle:python_3000_raise_comma") for plugin "pycodestyle.python_3000_raise_comma".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.tabs_obsolete", entry_point="pycodestyle.tabs_obsolete = pycodestyle:tabs_obsolete") for plugin "pycodestyle.tabs_obsolete".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.tabs_or_spaces", entry_point="pycodestyle.tabs_or_spaces = pycodestyle:tabs_or_spaces") for plugin "pycodestyle.tabs_or_spaces".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.trailing_blank_lines", entry_point="pycodestyle.trailing_blank_lines = pycodestyle:trailing_blank_lines") for plugin "pycodestyle.trailing_blank_lines".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.trailing_whitespace", entry_point="pycodestyle.trailing_whitespace = pycodestyle:trailing_whitespace") for plugin "pycodestyle.trailing_whitespace".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.whitespace_around_comma", entry_point="pycodestyle.whitespace_around_comma = pycodestyle:whitespace_around_comma") for plugin "pycodestyle.whitespace_around_comma".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.whitespace_around_keywords", entry_point="pycodestyle.whitespace_around_keywords = pycodestyle:whitespace_around_keywords") for plugin "pycodestyle.whitespace_around_keywords".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.whitespace_around_named_parameter_equals", entry_point="pycodestyle.whitespace_around_named_parameter_equals = pycodestyle:whitespace_around_named_parameter_equals") for plugin "pycodestyle.whitespace_around_named_parameter_equals".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.whitespace_around_operator", entry_point="pycodestyle.whitespace_around_operator = pycodestyle:whitespace_around_operator") for plugin "pycodestyle.whitespace_around_operator".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.whitespace_before_comment", entry_point="pycodestyle.whitespace_before_comment = pycodestyle:whitespace_before_comment") for plugin "pycodestyle.whitespace_before_comment".
manager.py 287 DEBUG Loaded Plugin(name="pycodestyle.whitespace_before_parameters", entry_point="pycodestyle.whitespace_before_parameters = pycodestyle:whitespace_before_parameters") for plugin "pycodestyle.whitespace_before_parameters".
manager.py 287 DEBUG Loaded Plugin(name="Q0", entry_point="Q0 = flake8_quotes:QuoteChecker") for plugin "Q0".
manager.py 287 DEBUG Loaded Plugin(name="S001", entry_point="S001 = flake8_pep3101:Flake8Pep3101") for plugin "S001".
manager.py 287 DEBUG Loaded Plugin(name="D", entry_point="D = flake8_docstrings:pep257Checker") for plugin "D".
manager.py 287 DEBUG Loaded Plugin(name="C4", entry_point="C4 = flake8_comprehensions:ComprehensionChecker") for plugin "C4".
manager.py 287 DEBUG Loaded Plugin(name="C81", entry_point="C81 = flake8_commas:CommaChecker") for plugin "C81".
manager.py 287 DEBUG Loaded Plugin(name="A00", entry_point="A00 = flake8_builtins:BuiltinsChecker") for plugin "A00".
manager.py 287 DEBUG Loaded Plugin(name="B", entry_point="B = bugbear:BugBearChecker") for plugin "B".
manager.py 287 DEBUG Loaded Plugin(name="B90", entry_point="B90 = flake8_blind_except:check_blind_except") for plugin "B90".
manager.py 272 INFO Loading entry-points for "flake8.listen".
manager.py 272 INFO Loading entry-points for "flake8.report".
manager.py 287 DEBUG Loaded Plugin(name="default", entry_point="default = flake8.formatting.default:Default") for plugin "default".
manager.py 287 DEBUG Loaded Plugin(name="pylint", entry_point="pylint = flake8.formatting.default:Pylint") for plugin "pylint".
manager.py 287 DEBUG Loaded Plugin(name="quiet-filename", entry_point="quiet-filename = flake8.formatting.default:FilenameOnly") for plugin "quiet-filename".
manager.py 287 DEBUG Loaded Plugin(name="quiet-nothing", entry_point="quiet-nothing = flake8.formatting.default:Nothing") for plugin "quiet-nothing".
manager.py 176 INFO Loading plugin "R70" from entry-point.
manager.py 176 INFO Loading plugin "N8" from entry-point.
manager.py 176 INFO Loading plugin "C90" from entry-point.
manager.py 176 INFO Loading plugin "F" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.ambiguous_identifier" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.bare_except" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.blank_lines" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.break_around_binary_operator" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.comparison_negative" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.comparison_to_singleton" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.comparison_type" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.compound_statements" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.continued_indentation" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.explicit_line_join" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.extraneous_whitespace" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.imports_on_separate_lines" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.indentation" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.maximum_line_length" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.missing_whitespace" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.missing_whitespace_after_import_keyword" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.missing_whitespace_around_operator" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.module_imports_on_top_of_file" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.python_3000_backticks" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.python_3000_has_key" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.python_3000_not_equal" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.python_3000_raise_comma" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.tabs_obsolete" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.tabs_or_spaces" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.trailing_blank_lines" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.trailing_whitespace" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.whitespace_around_comma" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.whitespace_around_keywords" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.whitespace_around_named_parameter_equals" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.whitespace_around_operator" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.whitespace_before_comment" from entry-point.
manager.py 176 INFO Loading plugin "pycodestyle.whitespace_before_parameters" from entry-point.
manager.py 176 INFO Loading plugin "Q0" from entry-point.
manager.py 176 INFO Loading plugin "S001" from entry-point.
manager.py 176 INFO Loading plugin "D" from entry-point.
manager.py 176 INFO Loading plugin "C4" from entry-point.
manager.py 176 INFO Loading plugin "C81" from entry-point.
manager.py 176 INFO Loading plugin "A00" from entry-point.
manager.py 176 INFO Loading plugin "B" from entry-point.
manager.py 176 INFO Loading plugin "B90" from entry-point.
manager.py 176 INFO Loading plugin "default" from entry-point.
manager.py 176 INFO Loading plugin "pylint" from entry-point.
manager.py 176 INFO Loading plugin "quiet-filename" from entry-point.
manager.py 176 INFO Loading plugin "quiet-nothing" from entry-point.
manager.py 231 DEBUG Registering options from plugin "R70" on OptionManager <flake8.options.manager.OptionManager object at 0x10cc48160>
manager.py 210 DEBUG Registered option "Option(None, --radon-max-cc, action=store, default=-1, dest=radon_max_cc, type=int, callback=None, help=Radon complexity threshold, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --radon-no-assert, action=store_true, default=False, dest=no_assert, type=None, callback=None, help=Radon will ignore assert statements, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 219 DEBUG Removing ['R70'] from the default ignore list
manager.py 225 DEBUG Attempted to remove R70 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['R70']
manager.py 231 DEBUG Registering options from plugin "N8" on OptionManager <flake8.options.manager.OptionManager object at 0x10cc48160>
manager.py 210 DEBUG Registered option "Option(None, --ignore-names, action=store, default=setUp,tearDown,setUpClass,tearDownClass, dest=ignore_names, type=string, callback=None, help=List of names the pep8-naming plugin should ignore. (Defaults to %default), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 219 DEBUG Removing ['N8'] from the default ignore list
manager.py 225 DEBUG Attempted to remove N8 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['N8']
manager.py 231 DEBUG Registering options from plugin "C90" on OptionManager <flake8.options.manager.OptionManager object at 0x10cc48160>
manager.py 210 DEBUG Registered option "Option(None, --max-complexity, action=store, default=-1, dest=max_complexity, type=int, callback=None, help=McCabe complexity threshold, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 219 DEBUG Removing ['C90'] from the default ignore list
manager.py 225 DEBUG Attempted to remove C90 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['C90']
manager.py 231 DEBUG Registering options from plugin "F" on OptionManager <flake8.options.manager.OptionManager object at 0x10cc48160>
manager.py 210 DEBUG Registered option "Option(None, --builtins, action=None, default=None, dest=builtins, type=None, callback=None, help=define more built-ins, comma separated, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --doctests, action=store_true, default=False, dest=doctests, type=None, callback=None, help=check syntax of the doctests, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --include-in-doctest, action=None, default=, dest=include_in_doctest, type=string, callback=None, help=Run doctests only on these files, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --exclude-from-doctest, action=None, default=, dest=exclude_from_doctest, type=string, callback=None, help=Skip these files when running doctests, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 219 DEBUG Removing ['F'] from the default ignore list
manager.py 225 DEBUG Attempted to remove F from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['F']
manager.py 231 DEBUG Registering options from plugin "Q0" on OptionManager <flake8.options.manager.OptionManager object at 0x10cc48160>
manager.py 210 DEBUG Registered option "Option(None, --quotes, action=store, default=None, dest=quotes, type=choice, callback=None, help=Deprecated alias for `--inline-quotes`, callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --inline-quotes, action=store, default=', dest=inline_quotes, type=choice, callback=None, help=Quote to expect in all files (default: '), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --multiline-quotes, action=store, default=None, dest=multiline_quotes, type=choice, callback=None, help=Quote to expect in all files (default: """), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 219 DEBUG Removing ['Q0'] from the default ignore list
manager.py 225 DEBUG Attempted to remove Q0 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['Q0']
manager.py 219 DEBUG Removing ['S001'] from the default ignore list
manager.py 225 DEBUG Attempted to remove S001 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['S001']
manager.py 219 DEBUG Removing ['D'] from the default ignore list
manager.py 225 DEBUG Attempted to remove D from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['D']
manager.py 219 DEBUG Removing ['C4'] from the default ignore list
manager.py 225 DEBUG Attempted to remove C4 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['C4']
manager.py 219 DEBUG Removing ['C81'] from the default ignore list
manager.py 225 DEBUG Attempted to remove C81 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['C81']
manager.py 219 DEBUG Removing ['A00'] from the default ignore list
manager.py 225 DEBUG Attempted to remove A00 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['A00']
manager.py 231 DEBUG Registering options from plugin "B" on OptionManager <flake8.options.manager.OptionManager object at 0x10cc48160>
manager.py 234 DEBUG Extending default ignore list with ['B901', 'B902', 'B903', 'B950']
manager.py 219 DEBUG Removing ['B'] from the default ignore list
manager.py 225 DEBUG Attempted to remove B from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['B']
manager.py 219 DEBUG Removing ['B90'] from the default ignore list
manager.py 225 DEBUG Attempted to remove B90 from default ignore but it was not a member of the list.
manager.py 244 DEBUG Extending default select list with ['B90']
config.py 235 DEBUG User configuration files have no flake8 section
config.py 224 DEBUG Local configuration files have no flake8 section
aggregator.py 52 DEBUG Extended default ignore list: ['B901', 'B950', 'B903', 'B902']
aggregator.py 55 DEBUG Merged default ignore list: ['E123', 'E226', 'E24', 'E121', 'B950', 'B903', 'E704', 'W503', 'W504', 'B901', 'E126', 'B902']
aggregator.py 59 DEBUG Extended default select list: ['R70', 'C4', 'N8', 'C81', 'A00', 'B90', 'B', 'D', 'F', 'Q0', 'C90', 'S001']
manager.py 208 DEBUG Providing options to plugin "R70".
manager.py 208 DEBUG Providing options to plugin "N8".
manager.py 208 DEBUG Providing options to plugin "C90".
manager.py 208 DEBUG Providing options to plugin "F".
manager.py 208 DEBUG Providing options to plugin "Q0".
manager.py 376 DEBUG Retrieving plugin for "default".
manager.py 371 DEBUG Checking for "default" in plugin type manager.
manager.py 376 DEBUG Retrieving plugin for "default".
checker.py 341 INFO Making checkers
checker.py 198 DEBUG "/Users/sobolev/Desktop/test_project/server/main_app/views.py" has not been excluded
checker.py 248 INFO Checking 1 files
application.py 311 INFO Finished running
application.py 339 INFO Reporting errors
style_guide.py 273 DEBUG Deciding if "D100" should be reported
style_guide.py 277 DEBUG The user configured "D100" to be "Ignored.Implicitly", "Ignored.Explicitly"
style_guide.py 312 DEBUG "D100" will be "Decision.Ignored"
style_guide.py 95 DEBUG Violation(code='D100', filename='/Users/sobolev/Desktop/test_project/server/main_app/views.py', line_number=1, column_number=1, text='Missing docstring in public module', physical_line='# -*- coding: utf-8 -*-\n') is not inline ignored
style_guide.py 273 DEBUG Deciding if "D103" should be reported
style_guide.py 277 DEBUG The user configured "D103" to be "Ignored.Implicitly", "Selected.Implicitly"
style_guide.py 312 DEBUG "D103" will be "Decision.Selected"
style_guide.py 95 DEBUG Violation(code='D103', filename='/Users/sobolev/Desktop/test_project/server/main_app/views.py', line_number=8, column_number=1, text='Missing docstring in public function', physical_line='def fetch_some_data() -> dict:\n') is not inline ignored
style_guide.py 273 DEBUG Deciding if "D401" should be reported
style_guide.py 277 DEBUG The user configured "D401" to be "Ignored.Implicitly", "Ignored.Explicitly"
style_guide.py 312 DEBUG "D401" will be "Decision.Ignored"
style_guide.py 95 DEBUG Violation(code='D401', filename='/Users/sobolev/Desktop/test_project/server/main_app/views.py', line_number=12, column_number=1, text='First line should be in imperative mood; try rephrasing', physical_line='def index(request):\n') is not inline ignored
application.py 343 INFO Found a total of 3 violations and reported 1
===================== 1 failed, 23 passed in 4.41 seconds ======================
+ /usr/bin/python3 -B -m pytest
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-flake8-1.0.7, configfile: tox.ini
plugins: flake8-1.0.7, flaky-3.6.1, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, asyncio-0.14.0, expect-1.1.0, pyfakefs-4.1.0, cov-2.11.1, mock-3.5.1, httpbin-1.0.0, xdist-2.2.1, hypothesis-6.3.1
collected 16 items
pytest_flake8.py F [ 6%]
setup.py . [ 12%]
test_flake8.py ............x. [100%]
================================================================================= FAILURES =================================================================================
_______________________________________________________________________________ FLAKE8-check _______________________________________________________________________________
/home/tkloczko/rpmbuild/BUILD/pytest-flake8-1.0.7/pytest_flake8.py:92:1: H401: docstring should not start with a space
---------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------
WARNING flake8.options.manager:manager.py:207 option --max-complexity: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
========================================================================= short test summary info ==========================================================================
FAILED pytest_flake8.py::FLAKE8
================================================================= 1 failed, 14 passed, 1 xfailed in 4.01s ==================================================================
To reproduce, create a conftest.py with the following content:
from gevent import monkey
monkey.patch_all()
And run py.test --flake8 in that folder.
py.test itself runs fine, so does flake8, but pytest-flake8 hangs.
Here is what happens when someone is trying to add some ignore options:
Editing setup.cfg
and adding
[pytest]
flake8-ignore=D D102
And while running it we can observe that the ignore option was loaded due to the changed header but right below it we can also observe that it was clearly not working.
We even tried alternative separator (comma) and in this case it has the same (non-filtering) behaviour but it does not display the ignoring text in the header.
python -m pytest --flake8
=============================================================================================== test session starts ===============================================================================================
platform darwin -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /usr/local/opt/python3/bin/python3.5
cachedir: .cache
rootdir: /Users/sorins/Documents/dev/os/wstools, inifile: setup.cfg
plugins: timeout-1.0.0, asyncio-0.3.0, cov-2.2.1, flake8-0.5, instafail-0.3.0, pep8-1.0.6, tornado-0.4.4, xdist-1.14
collected 4 items
tests/test_wsdl.py FAILED
tests/test_wsdl.py::WSDLToolsTestCase::test_all PASSED
tests/test_wstools_net.py FAILED
tests/test_wstools_net.py::test_runner PASSED
==================================================================================================== FAILURES =====================================================================================================
__________________________________________________________________________________________ FLAKE8-check(ignoring D,D102) __________________________________________________________________________________________
/Users/sorins/Documents/dev/os/wstools/tests/test_wsdl.py:48:1: D102 Missing docstring in public method
Just to increase the level of non-sense about the implementation we already have these ignores configured in the setup.cfg
[flake8]
ignore=D,E402
Flake8 is able to use these ignores but pytest-flake8
not only that is expecting other options (why?!) but based on the documentation it does expect them with space separators instead of commas.
I tried to add pytest-flake8
to several projects that I maintain just because they were already using pytest and consolidating the build logic did make sense. Still, it seems that it never works.
tl;dr The junit.xml
report generated when running with --flake8
is about x130 (130 times) of the report size without --flake8
.
When running py.test
on a relatively large project without using --flake8
option, the behavior is "ok". py.test
collects about 160 "items" from a project of about 160 modules, and outputs a junit.xml
report around 1.4MB in size.
In contrast, when running with --flake8
option, on the same source project, py.test
collects about 314 items and outputs a report around 190MB in size.
My environment is:
platform darwin -- Python 2.7.11, pytest-3.0.1, py-1.4.31, pluggy-0.3.1
django settings: my_project.test_settings (from environment variable)
rootdir: /Users/pavel/project_root, inifile: pytest.ini
plugins: cov-2.3.1, django-2.9.1, flake8-0.6, mock-1.2
My pytest.ini
is:
[pytest]
DJANGO_SETTINGS_MODULE = my_project.test_settings
flake8-ignore =
*.py E402 E126 E127 E265 E128 W503 E122 E731 E713 W191 E101 E226
urls.py ALL
**/migrations/** ALL
**/tests/** E501
flake8-max-line-length = 110
addopts =
--flake8
--junitxml=reports/junit.xml
Seems that pytest==2.9.2
does not result in the same behaviour. Specifically, if existing compiled pyc/cache files of the modules exist (from the pytest==3.0.1 run), many of the collected items are skipped, resulting in a small xml file. However, if cache/pyc files are cleared, the tests report is again at 190MB. Running without --flake8
again results in a 1.4MB xml.
I'm running the tests with a command like this:
pytest --flake8 src/database/tables.py
However, whatever I do, all flake8
tests are skipped:
collected 1 item
src/database/tables.py s [100%]
flake8
works fine on its own. Any ideas where to look for the problem? Thanks!
My job breaks when upgrading the package to the latest version:
https://travis-ci.org/juanifioren/django-oidc-provider/jobs/410428511
Versions:
Python 3.5.3, pytest-3.7.0, py-1.5.4, pluggy-0.7.1
atomicwrites==1.1.5,attrs==18.1.0,certifi==2018.4.16,chardet==3.0.4,coverage==4.5.1,Django==2.0.7,django-oidc-provider==0.6.1,flake8==3.5.0,future==0.16.0,idna==2.7,mccabe==0.6.1,mock==2.0.0,more-itertools==4.3.0,pathlib2==2.3.2,pbr==4.2.0,pluggy==0.7.1,psycopg2==2.7.5,py==1.5.4,pycodestyle==2.3.1,pycryptodomex==3.6.4,pyflakes==1.6.0,pyjwkest==1.4.0,pytest==3.7.0,pytest-cov==2.5.1,pytest-django==3.3.3,pytest-flake8==1.0.2,pytz==2018.5,requests==2.19.1,six==1.11.0,urllib3==1.23
Error:
../.tox/py27-django19/lib/python2.7/site-packages/_pytest/runner.py:201: in __init__
self.result = func()
../.tox/py27-django19/lib/python2.7/site-packages/_pytest/runner.py:261: in <lambda>
call = CallInfo(lambda: list(collector.collect()), "collect")
../.tox/py27-django19/lib/python2.7/site-packages/_pytest/main.py:475: in collect
for x in self._collect(arg):
../.tox/py27-django19/lib/python2.7/site-packages/_pytest/main.py:519: in _collect
for x in root._collectfile(pkginit):
E AttributeError: 'Flake8Item' object has no attribute '_collectfile'
I would like to flake8 a script that has no file extension. I've tried setting various ini values such as flake8-extensions = *
without success. Perhaps this could be supported via a configuration param with a list of files to explicitly check?
I'm posting this mostly as an FYI for the people who had their CI pipelines starting to fail related to this package, with a message that looks sort of like this:
/usr/local/lib/python3.6/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/usr/local/lib/python3.6/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/usr/local/lib/python3.6/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/usr/local/lib/python3.6/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
I'm not sure how, but it appears that the code for version 0.8.1 on pip may have changed, causing incompatibility issues. The solution to this issue is to update the version of this package and possibly also pytest:
requirements.txt
- pytest==3.0.7
- pytest-flake8==0.8.1
+ pytest==3.2.3
+ pytest-flake8==0.9.1
Hopefully this shows up in google for people who gets this issue so they can solve it quickly 👍
Getting failures like this when using flake8==3.5.0
:
=================================== FAILURES ===================================
_________________________________ FLAKE8-check _________________________________
.tox/py36/lib/python3.6/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
.tox/py36/lib/python3.6/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
.tox/py36/lib/python3.6/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
.tox/py36/lib/python3.6/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
test_flake8.py
also fails now:
$ tox -e py27
GLOB sdist-make: /Users/romanlevin/workspace/pytest-flake8/setup.py
py27 inst-nodeps: /Users/romanlevin/workspace/pytest-flake8/.tox/dist/pytest-flake8-0.8.1.zip
py27 installed: configparser==3.5.0,enum34==1.1.6,flake8==3.5.0,mccabe==0.6.1,py==1.4.34,pycodestyle==2.3.1,pyflakes==1.6.0,pytest==3.2.3,pytest-flake8==0.8.1
py27 runtests: PYTHONHASHSEED='3487679041'
py27 runtests: commands[0] | py.test --junitxml=/Users/romanlevin/workspace/pytest-flake8/.tox/py27/log/junit-py27.xml
=========================================================================================== test session starts ============================================================================================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /Users/romanlevin/workspace/pytest-flake8, inifile: tox.ini
plugins: flake8-0.8.1
collected 13 items
pytest_flake8.py s
setup.py s
test_flake8.py s..FFF.FF.F
-------------------------------------------------------- generated xml file: /Users/romanlevin/workspace/pytest-flake8/.tox/py27/log/junit-py27.xml --------------------------------------------------------
================================================================================================= FAILURES =================================================================================================
_______________________________________________________________________________________ TestIgnores.test_ignores_all _______________________________________________________________________________________
self = <test_flake8.TestIgnores instance at 0x10b489f38>, testdir = <Testdir local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_ignores_all0')>
def test_ignores_all(self, testdir):
"""Verify success when all errors are ignored."""
testdir.makeini("""
[pytest]
flake8-ignore = E203
*.py E300
tests/*.py ALL E203 # something
""")
testdir.tmpdir.ensure("xy.py")
testdir.tmpdir.ensure("tests/hello.py")
result = testdir.runpytest("--flake8", "-s")
> assert result.ret == 0
E assert 1 == 0
E + where 1 = <_pytest.pytester.RunResult instance at 0x10b4fdef0>.ret
/Users/romanlevin/workspace/pytest-flake8/test_flake8.py:49: AssertionError
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_ignores_all0, inifile: tox.ini
plugins: flake8-0.8.1
collected 1 item
xy.py F
=================================== FAILURES ===================================
_______________________ FLAKE8-check(ignoring E203 E300) _______________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
=========================== 1 failed in 0.09 seconds ===========================
________________________________________________________________________________________ TestIgnores.test_w293w292 _________________________________________________________________________________________
self = <test_flake8.TestIgnores instance at 0x10b4706c8>, testdir = <Testdir local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_w293w2920')>
example = local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_w293w2920/test_w293w292.py')
def test_w293w292(self, testdir, example):
result = testdir.runpytest("--flake8", )
result.stdout.fnmatch_lines([
# "*plugins*flake8*",
"*W293*",
> "*W292*",
])
E Failed: nomatch: '*W293*'
E and: u'============================= test session starts =============================='
E and: u'platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0'
E and: u'rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_w293w2920, inifile:'
E and: u'plugins: flake8-0.8.1'
E and: u'collected 1 item'
E and: u''
E and: u'test_w293w292.py F'
E and: u''
E and: u'=================================== FAILURES ==================================='
E and: u'_________________________________ FLAKE8-check _________________________________'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest'
E and: u' self.statistics)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call'
E and: u' res = func(*args, **kwargs)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file'
E and: u' app.find_plugins()'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins'
E and: u' self.prelim_opts.config,'
E and: u"E AttributeError: 'NoneType' object has no attribute 'config'"
E and: u'=========================== 1 failed in 0.05 seconds ==========================='
E and: u''
E remains unmatched: '*W293*'
/Users/romanlevin/workspace/pytest-flake8/test_flake8.py:61: Failed
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_w293w2920, inifile:
plugins: flake8-0.8.1
collected 1 item
test_w293w292.py F
=================================== FAILURES ===================================
_________________________________ FLAKE8-check _________________________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
=========================== 1 failed in 0.05 seconds ===========================
______________________________________________________________________________________ TestIgnores.test_mtime_caching ______________________________________________________________________________________
self = <test_flake8.TestIgnores instance at 0x10b55f9e0>, testdir = <Testdir local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_mtime_caching0')>
example = local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_mtime_caching0/test_mtime_caching.py')
def test_mtime_caching(self, testdir, example):
testdir.tmpdir.ensure("hello.py")
result = testdir.runpytest("--flake8", )
result.stdout.fnmatch_lines([
# "*plugins*flake8*",
"*W293*",
"*W292*",
> "*1 failed*",
])
E Failed: nomatch: '*W293*'
E and: u'============================= test session starts =============================='
E and: u'platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0'
E and: u'rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_mtime_caching0, inifile:'
E and: u'plugins: flake8-0.8.1'
E and: u'collected 2 items'
E and: u''
E and: u'hello.py F'
E and: u'test_mtime_caching.py F'
E and: u''
E and: u'=================================== FAILURES ==================================='
E and: u'_________________________________ FLAKE8-check _________________________________'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest'
E and: u' self.statistics)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call'
E and: u' res = func(*args, **kwargs)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file'
E and: u' app.find_plugins()'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins'
E and: u' self.prelim_opts.config,'
E and: u"E AttributeError: 'NoneType' object has no attribute 'config'"
E and: u'_________________________________ FLAKE8-check _________________________________'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest'
E and: u' self.statistics)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call'
E and: u' res = func(*args, **kwargs)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file'
E and: u' app.find_plugins()'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins'
E and: u' self.prelim_opts.config,'
E and: u"E AttributeError: 'NoneType' object has no attribute 'config'"
E and: u'=========================== 2 failed in 0.09 seconds ==========================='
E and: u''
E remains unmatched: '*W293*'
/Users/romanlevin/workspace/pytest-flake8/test_flake8.py:72: Failed
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_mtime_caching0, inifile:
plugins: flake8-0.8.1
collected 2 items
hello.py F
test_mtime_caching.py F
=================================== FAILURES ===================================
_________________________________ FLAKE8-check _________________________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
_________________________________ FLAKE8-check _________________________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
=========================== 2 failed in 0.09 seconds ===========================
_____________________________________________________________________________________________ test_ok_verbose ______________________________________________________________________________________________
testdir = <Testdir local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_ok_verbose0')>
def test_ok_verbose(testdir):
p = testdir.makepyfile("""
class AClass:
pass
""")
p = p.write(p.read() + "\n")
result = testdir.runpytest("--flake8", "--verbose")
result.stdout.fnmatch_lines([
"*test_ok_verbose*",
])
> assert result.ret == 0
E assert 1 == 0
E + where 1 = <_pytest.pytester.RunResult instance at 0x10b4ff488>.ret
/Users/romanlevin/workspace/pytest-flake8/test_flake8.py:117: AssertionError
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0 -- /Users/romanlevin/workspace/pytest-flake8/.tox/py27/bin/python2.7
cachedir: .cache
rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_ok_verbose0, inifile:
plugins: flake8-0.8.1
collecting ... collected 1 item
test_ok_verbose.py FAILED
=================================== FAILURES ===================================
_________________________________ FLAKE8-check _________________________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
=========================== 1 failed in 0.05 seconds ===========================
____________________________________________________________________________________________ test_keyword_match ____________________________________________________________________________________________
testdir = <Testdir local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_keyword_match0')>
def test_keyword_match(testdir):
testdir.makepyfile("""
def test_hello():
a=[ 1,123]
#
""")
result = testdir.runpytest("--flake8", "-mflake8")
result.stdout.fnmatch_lines([
"*E201*",
> "*1 failed*",
])
E Failed: nomatch: '*E201*'
E and: u'============================= test session starts =============================='
E and: u'platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0'
E and: u'rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_keyword_match0, inifile:'
E and: u'plugins: flake8-0.8.1'
E and: u'collected 2 items'
E and: u''
E and: u'test_keyword_match.py F'
E and: u''
E and: u'=================================== FAILURES ==================================='
E and: u'_________________________________ FLAKE8-check _________________________________'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest'
E and: u' self.statistics)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call'
E and: u' res = func(*args, **kwargs)'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file'
E and: u' app.find_plugins()'
E and: u'/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins'
E and: u' self.prelim_opts.config,'
E and: u"E AttributeError: 'NoneType' object has no attribute 'config'"
E and: u'============================== 1 tests deselected =============================='
E and: u'==================== 1 failed, 1 deselected in 0.05 seconds ===================='
E and: u''
E remains unmatched: '*E201*'
/Users/romanlevin/workspace/pytest-flake8/test_flake8.py:129: Failed
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_keyword_match0, inifile:
plugins: flake8-0.8.1
collected 2 items
test_keyword_match.py F
=================================== FAILURES ===================================
_________________________________ FLAKE8-check _________________________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:115: in runtest
self.statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/py/_io/capture.py:150: in call
res = func(*args, **kwargs)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:180: in check_file
app.find_plugins()
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/flake8/main/application.py:176: in find_plugins
self.prelim_opts.config,
E AttributeError: 'NoneType' object has no attribute 'config'
============================== 1 tests deselected ==============================
==================== 1 failed, 1 deselected in 0.05 seconds ====================
_______________________________________________________________________________________________ test_strict ________________________________________________________________________________________________
testdir = <Testdir local('/private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_strict0')>
def test_strict(testdir):
testdir.makepyfile("")
result = testdir.runpytest("--strict", "--flake8")
> assert result.ret == 0
E assert 2 == 0
E + where 2 = <_pytest.pytester.RunResult instance at 0x10b69fa28>.ret
/Users/romanlevin/workspace/pytest-flake8/test_flake8.py:154: AssertionError
------------------------------------------------------------------------------------------- Captured stdout call -------------------------------------------------------------------------------------------
============================= test session starts ==============================
platform darwin -- Python 2.7.14, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /private/var/folders/kd/6m65nq_96nn4sz2ft_1rgzq80000gp/T/pytest-of-romanlevin/pytest-6/testdir/test_strict0, inifile:
plugins: flake8-0.8.1
collected 0 items / 1 errors
==================================== ERRORS ====================================
______________________________ ERROR collecting _______________________________
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:71: in pytest_collect_file
statistics=config._flake8statistics)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/pytest_flake8.py:89: in __init__
self.add_marker("flake8")
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/_pytest/main.py:402: in add_marker
marker = getattr(MARK_GEN, marker)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/_pytest/mark.py:264: in __getattr__
self._check(name)
/Users/romanlevin/workspace/pytest-flake8/.tox/py27/lib/python2.7/site-packages/_pytest/mark.py:279: in _check
raise AttributeError("%r not a registered marker" % (name,))
E AttributeError: 'flake8' not a registered marker
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.28 seconds ============================
============================================================================== 6 failed, 4 passed, 3 skipped in 0.97 seconds ===============================================================================
ERROR: InvocationError: '/Users/romanlevin/workspace/pytest-flake8/.tox/py27/bin/py.test --junitxml=/Users/romanlevin/workspace/pytest-flake8/.tox/py27/log/junit-py27.xml'
_________________________________________________________________________________________________ summary __________________________________________________________________________________________________
ERROR: py27: commands failed
I discovered that flake8 tests are executed after the unittest are executed which doesn't make much sense. The idea is that unittests do take a very long time to execute but linting is much faster.
You want to run linting before running the tests and eventually even stopping the execution right away if linting fails.
I am not sure if this is a limitation of pytest but even if it is, it would should be sorted because without it we are better off using flake8 outside pytest.
Many people, including myself, are also using tox and if pytest-flake8 is not able to run before the unittests, I would prefer to trigger flake8 before pytest from tox and not use pytest-flake8
plugin.
Test test_keyword_match
is failing on my computer. Here's the log: pytest-flake8.log
Here's the output of pip freeze
:
attrs==17.4.0
flake8==3.5.0
mccabe==0.6.1
pluggy==0.6.0
py==1.5.2
pycodestyle==2.3.1
pyflakes==1.6.0
pytest==3.3.2
pytest-flake8==0.9.1
six==1.11.0
What could be wrong?
Would you be interested to create a recipe for distributing pytest-flake8 via conda forge? Alternatively I could create one if you like.
I'm not entirely sure the issue is with pytest-flake8, but i'll report here first and wait for response.
Our tests started failing yesterday after the release of https://pypi.org/project/pytest/3.7.0/. The error was:
Installing collected packages: Willow, djangorestframework, six, pytz, l18n, chardet, idna, urllib3, certifi, requests, Unidecode, Django, django-modelcluster, django-treebeard, draftjs-exporter, webencodings, html5lib, django-taggit, Pillow, beautifulsoup4, wagtail, psycopg2, pyflakes, pycodestyle, mccabe, flake8, more-itertools, atomicwrites, attrs, pluggy, pathlib2, py, pytest, pytest-flake8, sqlparse, django-debug-toolbar, pep8, asn1crypto, pycparser, cffi, cryptography, pynacl, bcrypt, pyasn1, paramiko, Fabric3
Successfully installed Django-2.0.7 Fabric3-1.14.post1 Pillow-5.2.0 Unidecode-0.4.21 Willow-1.1 asn1crypto-0.24.0 atomicwrites-1.1.5 attrs-18.1.0 bcrypt-3.1.4 beautifulsoup4-4.6.1 certifi-2018.4.16 cffi-1.11.5 chardet-3.0.4 cryptography-2.3 django-debug-toolbar-1.9.1 django-modelcluster-4.1 django-taggit-0.22.2 django-treebeard-4.3 djangorestframework-3.8.2 draftjs-exporter-2.1.2 flake8-3.5.0 html5lib-1.0.1 idna-2.7 l18n-2016.6.4 mccabe-0.6.1 more-itertools-4.2.0 paramiko-2.4.1 pathlib2-2.3.2 pep8-1.7.1 pluggy-0.7.1 psycopg2-2.7.5 py-1.5.4 pyasn1-0.4.4 pycodestyle-2.3.1 pycparser-2.18 pyflakes-1.6.0 pynacl-1.2.1 pytest-3.7.0 pytest-flake8-1.0.2 pytz-2018.5 requests-2.19.1 six-1.11.0 sqlparse-0.2.4 urllib3-1.23 wagtail-2.1.1 webencodings-0.5.1
touch requirements.txt.done
env/bin/pytest --flake8
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.7.0, py-1.5.4, pluggy-0.7.1
...
plugins: flake8-1.0.2
collected 0 items / 1 errors
==================================== ERRORS ====================================
______________________________ ERROR collecting _______________________________
env/lib/python3.5/site-packages/_pytest/runner.py:201: in __init__
self.result = func()
env/lib/python3.5/site-packages/_pytest/runner.py:261: in <lambda>
call = CallInfo(lambda: list(collector.collect()), "collect")
env/lib/python3.5/site-packages/_pytest/main.py:475: in collect
for x in self._collect(arg):
env/lib/python3.5/site-packages/_pytest/main.py:519: in _collect
for x in root._collectfile(pkginit):
E AttributeError: 'Flake8Item' object has no attribute '_collectfile'
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.17 seconds ============================
Makefile:24: recipe for target 'test' failed
After downgrading pytest to 3.6.4 the tests passed.
Is it a feature, or a bug?
I am keep on getting this log with every check.. Can I stopped them ?
---------------------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------------------
WARNING flake8.options.manager:manager.py:211 option --max-complexity: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
WARNING flake8.options.manager:manager.py:189 option --ignore-names: please update `help=` text to use %(default)s instead of %default -- this will be an error in the future
WARNING flake8.options.manager:manager.py:211 option --ignore-names: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
WARNING flake8.options.manager:manager.py:189 option --classmethod-decorators: please update `help=` text to use %(default)s instead of %default -- this will be an error in the future
WARNING flake8.options.manager:manager.py:211 option --classmethod-decorators: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
WARNING flake8.options.manager:manager.py:189 option --staticmethod-decorators: please update `help=` text to use %(default)s instead of %default -- this will be an error in the future
WARNING flake8.options.manager:manager.py:211 option --staticmethod-decorators: please update from optparse string `type=` to argparse callable `type=` -- this will be an error in the future
I would like this module to check my setup.py for flake8 validity, but for some reason it's not picking it up for me.
Is there any setting to list other files to check?
Could this be related to me using a src/
type layout for my package?
As of the release of pytest 5.4.0 earlier today, attempting to run pytest with pytest-flake8 installed and with [pytest]filterwarnings
set to error
causes the run to fail immediately with:
.tox/py36/lib/python3.6/site-packages/pluggy/hooks.py:286: in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
.tox/py36/lib/python3.6/site-packages/pluggy/manager.py:93: in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
.tox/py36/lib/python3.6/site-packages/pluggy/manager.py:87: in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
.tox/py36/lib/python3.6/site-packages/pytest_flake8.py:72: in pytest_collect_file
statistics=config._flake8statistics)
.tox/py36/lib/python3.6/site-packages/_pytest/nodes.py:83: in __call__
warnings.warn(NODE_USE_FROM_PARENT.format(name=self.__name__), stacklevel=2)
E pytest.PytestDeprecationWarning: direct construction of Flake8Item has been deprecated, please use Flake8Item.from_parent
This is due to the deprecation of direct constructors for Nodes
; see item 5975 under "Deprecations" in the release notes for pytest 5.4.0. pytest-flake8 thus needs to be updated; according to the release notes:
Subclasses are expected to use
super().from_parent
if they intend to expand the creation ofNodes
.
I realised that adding pytest-flake8
to you project is incompatible with use of python hacking package due to the conflict regarding flake8 version.
... flake8-3.0.4-py3.5.egg), Requirement.parse('flake8<2.6.0,>=2.5.4'), {'hacking'})
For good reasons hacking package restricts python linting packages installed to safe ranges, so people would not be surprised by their CI gates going broken.
If pytest-flake8
would allow a wider range of flake8 version we would not risk of having to implement ugly requirements.txt
workarounds like:
hacking
pytest-flake8<0.6
flake8<2.6.0
The last two lines are needed only because if pytest-flake8>=0.6
would also install flake8>3.0
.
If you have a new pip>=9.0
you can easily find conflicts using pip check
.
As i can judge the current maintainer can't maintain this porject for some reasons. I suggest to transfer this repository to pytest-dev community.
P.S Also it would be awesome to transfer PyPi package for publishing new version of this plugin.
pytest now comes with cache as a default module and doesn't load the pytest-cache plugin anymore, by not using the default one pytest-flake8 is not caching results anymore
Minimal reproduction: https://github.com/jacquerie/pytest-flake8-bug
I expect tests to run normally, but this is instead what I see:
% py.test --flake8 tests
================================================================= test session starts =================================================================
platform darwin -- Python 2.7.13, pytest-3.1.3, py-1.4.34, pluggy-0.4.0
Using --randomly-seed=1501011429
rootdir: /Users/jacquerie/Code/pytest-flake8-bug, inifile:
plugins: randomly-1.2.1, flake8-0.8.1
collected 4 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/main.py", line 105, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/main.py", line 140, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/main.py", line 150, in pytest_collection
INTERNALERROR> return session.perform_collect()
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/main.py", line 606, in perform_collect
INTERNALERROR> config=self.config, items=items)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
INTERNALERROR> return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/Users/jacquerie/.virtualenvs/flake8/lib/python2.7/site-packages/pytest_randomly.py", line 119, in pytest_collection_modifyitems
INTERNALERROR> current_module = item.module
INTERNALERROR> AttributeError: 'Flake8Item' object has no attribute 'module'
============================================================ no tests ran in 0.01 seconds =============================================================
Following the docs, I added the flake8-ignore
setting to my setup.cfg
, which now looks like this:
[aliases]
test=pytest
[tool:pytest]
addopts = --verbose
[pytest]
flake8-ignore =
setup.py F401
docs/conf.py ALL
tests/context.py E402 F401
However, when I run python setup.py test
, I get the error
error: error in setup.cfg: command 'PyTest' has no such option 'flake8_ignore'
I should mention that py.test --flake8
works.
Any help is greatly appreciated!
$ pytest --flake8
============================= test session starts ==============================
platform linux -- Python 3.7.1, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
cachedir: .tox/flake8/.pytest_cache
rootdir: /home/travis/build/dry-python/dependencies, inifile: pytest.ini
plugins: isort-0.2.1, flake8-1.0.2, black-0.3.2, celery-4.2.1
collecting 216 items / 3 skipped INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/_pytest/main.py", line 203, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/_pytest/main.py", line 242, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/manager.py", line 68, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/manager.py", line 62, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/_pytest/main.py", line 252, in pytest_collection
INTERNALERROR> return session.perform_collect()
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/_pytest/main.py", line 468, in perform_collect
INTERNALERROR> session=self, config=self.config, items=items
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/manager.py", line 68, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/manager.py", line 62, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/.tox/flake8/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/tests/conftest.py", line 8, in pytest_collection_modifyitems
INTERNALERROR> items[:] = [item for item in items if item.get_marker(linter)]
INTERNALERROR> File "/home/travis/build/dry-python/dependencies/tests/conftest.py", line 8, in <listcomp>
INTERNALERROR> items[:] = [item for item in items if item.get_marker(linter)]
INTERNALERROR> AttributeError: 'Flake8Item' object has no attribute 'get_marker'
==================== 3 skipped, 1 warnings in 0.56 seconds =====================
_____________________________________________________________________________________________________________ ERROR collecting ______________________________________________________________________________________________________________
/home/vagrant/.pyenv/versions/3.6.5/envs/turbo/lib/python3.6/site-packages/_pytest/runner.py:201: in __init__
self.result = func()
/home/vagrant/.pyenv/versions/3.6.5/envs/turbo/lib/python3.6/site-packages/_pytest/runner.py:261: in <lambda>
call = CallInfo(lambda: list(collector.collect()), "collect")
/home/vagrant/.pyenv/versions/3.6.5/envs/turbo/lib/python3.6/site-packages/_pytest/main.py:475: in collect
for x in self._collect(arg):
/home/vagrant/.pyenv/versions/3.6.5/envs/turbo/lib/python3.6/site-packages/_pytest/main.py:505: in _collect
col = root._collectfile(pkginit)
E AttributeError: 'Flake8Item' object has no attribute '_collectfile'
My Travis build broke when it upgraded this project from v1.0.0 to v1.0.1. Downgrading to v1.0.0 fixed my build.
Here's the error that I was receiving:
The command "pytest -s --cov=honeycomb --flake8" exited with 1.
flake8 supports [flake8]
in setup.cfg, but when using pytest-flake8 0.5 with flake8 2.6.0, the flake8 isn't obeyed
http://flake8.readthedocs.io/en/latest/config.html
Any chance there could be support for parsing the project's setup.cfg?
When running pytest with -f
after a flake8 error is fixed you get:
ERROR test_something.py::FLAKE8 - NotImplementedError: abstract
It seems to be related to #71 maybe?
I've made an example here: https://gist.github.com/sbv-csis/8b693ce75c335921f0fbded7fa2df9b5
The basic idea is that you start pytest -f
so it loops, and following flake8 problems it won't recover from
ERROR test_something.py::FLAKE8 - NotImplementedError: abstract
If you run py.test with --flake8 and -vv then the tests run very slowly and it also uses a huge amount of RAM.
This is caused by flake8's extreme amount of debug sent stderr when run with -vv, which is in turn captured by py.test.
A workaround is to set -vv via addopts config which isn't detected by flake8 but still applies to py.test.
In testing with just 8 files this reduced the time to run from 16 seconds to just 1.
With the recently released flake8 3.8.0a2 the plugin fails:
lib/python2.7/site-packages/pytest_flake8.py:191: in check_file
app.parse_preliminary_options_and_args(args)
AttributeError: 'Application' object has no attribute 'parse_preliminary_options_and_args'
Running pytest-flake8 against the latest flake8 (3.0.0b2), it fails with the error in the title. It appears that flake8 has moved the flake8.engine module.
When using easy_install
to install pytest-flake8, it doesn't protect against pre-releases, so the requirements on pytest-flake8 pick up the incompatible beta release. Perhaps pytest-flake8 should depend on flake8>=2.5,<3dev
until compatibility code can be added for flake8 3.0 support.
There are some discrepancies regarding version numbers of pytest-flake8.
__version__
says 0.2
0.3
0.4
After merging #2 , would you mind bumping to 0.5
(and pushing that to GitHub) in order to resolve this?
Since upgrading from pytest 3.4.2 to 3.5.0, pytest-flake8's tests are broken:
_____________________________ test_junit_classname _____________________________
testdir = <Testdir local('/build/pytest-of-nixbld/pytest-0/test_junit_classname0')>
def test_junit_classname(testdir):
testdir.makepyfile("")
result = testdir.runpytest("--flake8", "--junit-xml=TEST.xml")
junit = testdir.tmpdir.join("TEST.xml")
with open(str(junit)) as j_file:
j_text = j_file.read()
assert result.ret == 0
> assert 'classname=""' not in j_text
E assert 'classname=""' not in '<?xml version="1.0" encoding="utf-8"?><testsuite errors="0" failures="0" name="pytest" skips="0" tests="1" time="0.13...ile="test_junit_classname.py" line="-1" name="test_junit_classname" time="0.11962008476257324"></testcase></testsuite>'
/build/pytest-flake8-1.0.0/test_flake8.py:188: AssertionError
flake8-import-order has 2 options in ini files:
import-order-style
and application-import-names
https://github.com/PyCQA/flake8-import-order
It would be nice if pytest-flake8 could support them:
flake8-import-order-style
and flake8-application-import-names
In my CI Environment, I test against multiple versions of python. It would be nice if I could easily fire off a pipleline that just does the flake8 tests so I can easily isolate regressions in unit tests vs flake8 complaints.
Some sort of --flake8-checks-only
option or similar would be ideal for helping to isolate the source of the complaints.
Being able to directly specify a config file on the command line to pass along to the pytest-flake8 plugin would be a boon in terms of usability.
There are a number of options that might be supported in .flake8 which the corresponding --flake8*
options don't support. Being able to specify a custom config (without having to go through the boilerplate of tox.ini
) would improve usability for the plugin.
I regurarly use pytest-flake8
, but now I can't terminate the flake8 check with Ctrl+C, because the main thread is exited, but the tests still running.
foo@foo:~/test$ tox
py27 installed: attrs==17.3.0,backports-abc==0.5,certifi==2017.11.5,chardet==3.0.4,configparser==3.5.0,enum34==1.1.6,flake8==3.5.0,funcsigs==1.0.2,idna==2.6,lxml==4.1.1,mccabe==0.6.1,mock==2.0.0,pbr==3.1.1,pluggy
==0.6.0,py==1.5.2,pycodestyle==2.3.1,pyflakes==1.6.0,pytest==3.3.0,pytest-flake8==0.9.1,PyYAML==3.12,requests==2.18.4,selenium==3.8.0,singledispatch==3.4.0.3,six==1.11.0,tornado==4.5.2,urllib3==1.22 py27 runtests: PYTHONHASHSEED='782112150'
py27 runtests: commands[0] | py.test
FFFFFF^CERROR: KEYBOARDINTERRUPT
FFF^CERROR: keyboardinterrupt
foo@foo:~/test$ FFFFF
foo@foo:~/test$ F
foo@foo:~/test$
foo@foo:~/test$
foo@foo:~/test$ FF
foo@foo:~/test$ FFFFFFFF
I think, this is off-topic, but there are a lot of Captured log too:
manager.py 210 DEBUG Registered option "Option(-v, --verbose, action=count, default=0, dest=verbose, type=None, callback=None, help=Print more information about what is happening in flake8. Thi
s option is repeatable and will increase verbosity each time it is repeated., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(-q, --quiet, action=count, default=0, dest=quiet, type=None, callback=None, help=Report only file names, or nothing. This option is repeatable., c
allback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --count, action=store_true, default=None, dest=count, type=None, callback=None, help=Print total number of errors and warnings to standard e
rror and set the exit code to 1 if total is not empty., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --diff, action=store_true, default=None, dest=diff, type=None, callback=None, help=Report changes only within line number ranges in the unif
ied diff provided on standard in by the user., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --exclude, action=None, default=.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg, dest=exclude, type=None, callback=None, help=Comma-sepa
rated list of files or directories to exclude. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=patterns)".
manager.py 210 DEBUG Registered option "Option(None, --filename, action=None, default=*.py, dest=filename, type=None, callback=None, help=Only check for filenames matching the patterns in this
comma-separated list. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=patterns)".
manager.py 210 DEBUG Registered option "Option(None, --stdin-display-name, action=None, default=stdin, dest=stdin_display_name, type=None, callback=None, help=The name used when reporting error
s from code passed via stdin. This is useful for editors piping the file contents to flake8. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --format, action=None, default=default, dest=format, type=None, callback=None, help=Format errors according to the chosen formatter., callba
ck=None, callback_args=None, callback_kwargs=None, metavar=format)".
manager.py 210 DEBUG Registered option "Option(None, --hang-closing, action=store_true, default=None, dest=hang_closing, type=None, callback=None, help=Hang closing bracket instead of matching
indentation of opening bracket's line., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --ignore, action=None, default=E121,E123,E126,E226,E24,E704,W503,W504, dest=ignore, type=None, callback=None, help=Comma-separated list of e
rrors and warnings to ignore (or skip). For example, ``--ignore=E4,E51,W234``. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=errors)".
manager.py 210 DEBUG Registered option "Option(None, --max-line-length, action=None, default=79, dest=max_line_length, type=int, callback=None, help=Maximum allowed line length for the entirety
of this run. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=n)".
manager.py 210 DEBUG Registered option "Option(None, --select, action=None, default=E,F,W,C90, dest=select, type=None, callback=None, help=Comma-separated list of errors and warnings to enable.
For example, ``--select=E4,E51,W234``. (Default: %default), callback=None, callback_args=None, callback_kwargs=None, metavar=errors)".
manager.py 210 DEBUG Registered option "Option(None, --disable-noqa, action=store_true, default=False, dest=disable_noqa, type=None, callback=None, help=Disable the effect of "# noqa". This wil
l report errors on lines with "# noqa" at the end., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --show-source, action=store_true, default=None, dest=show_source, type=None, callback=None, help=Show the source generate each error or warn
ing., callback=None, callback_args=None, callback_kwargs=None, metavar=None)".
manager.py 210 DEBUG Registered option "Option(None, --statistics, action=store_true, default=None, dest=statistics, type=None, callback=None, help=Count errors and warnings., callback=None, ca
llback_args=None, callback_kwargs=None, metavar=None)".
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.