flake8-rst icon indicating copy to clipboard operation
flake8-rst copied to clipboard

flake8-rst vs flake8 argument incompatibility for filename/output_file

Open Olshansk opened this issue 4 years ago • 4 comments

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?

Olshansk avatar Dec 12 '20 23:12 Olshansk

Oh, see https://github.com/kataev/flake8-rst/issues/22. This package is just not maintained.

skirpichev avatar Dec 17 '20 08:12 skirpichev

So should I just send a PR to fix the --output-file and --filename discreptency?

Olshansk avatar Dec 17 '20 14:12 Olshansk

You could try to install the flake8-rst from the master branch and test. Your issue should be fixed.

Then, wait for a while if the new version will be released...

skirpichev avatar Dec 17 '20 15:12 skirpichev

Perhaps, this can be closed, as flake8-rst==0.8.0 was released. @Olshansk, can you confirm?

skirpichev avatar Feb 27 '21 05:02 skirpichev