python-formate / flake8-dunder-all

A Flake8 plugin and pre-commit hook which checks to ensure modules have defined '__all__'.
https://flake8-dunder-all.readthedocs.io/en/latest
MIT License
7 stars 2 forks source link

Can't ignore DALL000 through config file on flake8 v6 #54

Open FasterSpeeding opened 1 year ago

FasterSpeeding commented 1 year ago

Description

Trying to ignore DALL000 globally using a config file leads to a validation error when using flake8 v6.0.0

Steps to Reproduce

Run flake8 with the following .flake8 config file

[flake8]
ignore = DALL000

Actual result:

Traceback (most recent call last):
le_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Lucina\.pyenv\pyenv-win\versions\3.10.0\lib\runpy.py", line 86, in _run_code        
    exec(code, run_globals)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\Scripts\flake8.exe\__main__.py", line 7, in <module>
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\main\cli.py", line 23, in main
    app.run(argv)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\main\application.py", line 198, in run
    self._run(argv)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\main\application.py", line 186, in _run
    self.initialize(argv)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\main\application.py", line 165, in initialize
    self.plugins, self.options = parse_args(argv)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\options\parse_args.py", line 53, in parse_args
    opts = aggregator.aggregate_options(option_manager, cfg, cfg_dir, rest)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\options\aggregator.py", line 30, in aggregate_options
    parsed_config = config.parse_config(manager, cfg, cfg_dir)
  File "C:\Users\Lucina\Documents\vsc\Tanjun\venv\lib\site-packages\flake8\options\config.py", line 131, in parse_config
    raise ValueError(
ValueError: Error code 'DALL000' supplied to 'ignore' option does not match '^[A-Z]{1,3}[0-9]{0,3}$'

Expected result:

An error code which'll pass these checks is provided

Reproduces how often:

Every time this is used in the ignore section of a config file

Version

Installation source

Pip

AlbertUnruh commented 8 months ago

opened a pr to fix your the issue

while it's not merged you can specify flake-dunder-all as git+https://github.com/AlbertUnruh/flake8-dunder-all.git@master*

*you need to update your codes from DALLXXX to DALXXX