Skip to content

flake8-rst vs flake8 argument incompatibility for filename/output_file #24

@Olshansk

Description

@Olshansk

Stack trace:

$ flake8-rst --filename="*.rst" .

Traceback (most recent call last):
  File "/Users/olshansky/.pyenv/versions/3.7.7/bin/flake8-rst", line 10, in <module>
    sys.exit(main())
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8_rst/cli.py", line 16, in main
    app.run(argv)
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run
    self._run(argv)
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run
    self.initialize(argv)
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 336, in initialize
    self.make_formatter()
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8/main/application.py", line 228, in make_formatter
    self.formatter = formatter_class(self.options)
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8/plugins/manager.py", line 131, in execute
    return self.plugin(*args, **kwargs)  # pylint: disable=not-callable
  File "/Users/olshansky/.pyenv/versions/3.7.7/lib/python3.7/site-packages/flake8/formatting/base.py", line 48, in __init__
    self.filename = options.output_file
AttributeError: 'Namespace' object has no attribute 'output_file'

It seems that flake flake8 expects an argument called output_file as opposed to filename: https://github.com/PyCQA/flake8/blob/master/src/flake8/formatting/base.py#L48

$ pip freeze | grep "flake8"

flake8==3.8.4
flake8-bugbear==20.11.1
flake8-rst==0.7.2

$ python --version

Python 3.7.7

Has anyone run into this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions