New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptic error messages when providing a config file without the expected section #276

Closed
tovrstra opened this Issue Aug 25, 2017 · 3 comments

Comments

Projects
3 participants
@tovrstra
Copy link

tovrstra commented Aug 25, 2017

This accidentally happened to me and is easy to reproduce. Do the following in an empty directory, using pydocstyle 2.0.0:

echo '[pydcstyle]' > config
touch test.py
pydocstyle test.py --config=config

Then I get the following error message:

Traceback (most recent call last):
  File "/home/toon/.local/bin/pydocstyle", line 11, in <module>
    sys.exit(main())
  File "/home/toon/.local/lib/python2.7/site-packages/pydocstyle/cli.py", line 68, in main
    sys.exit(run_pydocstyle())
  File "/home/toon/.local/lib/python2.7/site-packages/pydocstyle/cli.py", line 43, in run_pydocstyle
    conf.get_files_to_check():
  File "/home/toon/.local/lib/python2.7/site-packages/pydocstyle/config.py", line 171, in get_files_to_check
    config = self._get_config(name)
  File "/home/toon/.local/lib/python2.7/site-packages/pydocstyle/config.py", line 262, in _get_config
    config = self._create_check_config(options)
  File "/home/toon/.local/lib/python2.7/site-packages/pydocstyle/config.py", line 383, in _create_check_config
    if cls._has_exclusive_option(options) or use_defaults:
  File "/home/toon/.local/lib/python2.7/site-packages/pydocstyle/config.py", line 497, in _has_exclusive_option
    cls.BASE_ERROR_SELECTION_OPTIONS])
AttributeError: 'NoneType' object has no attribute 'ignore'

It is too difficult to figure out what this error message means.

@Nurdok

This comment has been minimized.

Copy link
Member

Nurdok commented Aug 25, 2017

Thanks for reporting this @tovrstra. I agree there should be a better error message.

@Nurdok Nurdok added the Bugfix label Aug 25, 2017

@Nurdok Nurdok added this to Planned in Pydocstyle 2.1.1 Aug 25, 2017

@Nurdok Nurdok moved this from Planned to In Progress / Assigned in Pydocstyle 2.1.1 Sep 2, 2017

@Nurdok Nurdok moved this from In Progress / Assigned to Planned in Pydocstyle 2.1.1 Sep 2, 2017

shacharoo added a commit to shacharoo/pydocstyle that referenced this issue Sep 3, 2017

@shacharoo shacharoo self-assigned this Sep 3, 2017

@shacharoo shacharoo moved this from Planned to In Progress / Assigned in Pydocstyle 2.1.1 Sep 3, 2017

shacharoo added a commit to shacharoo/pydocstyle that referenced this issue Sep 3, 2017

shacharoo added a commit to shacharoo/pydocstyle that referenced this issue Sep 3, 2017

shacharoo added a commit to shacharoo/pydocstyle that referenced this issue Sep 3, 2017

@shacharoo

This comment has been minimized.

Copy link
Member

shacharoo commented Sep 3, 2017

Implemented in #280 .

@shacharoo shacharoo closed this Sep 3, 2017

@shacharoo shacharoo moved this from In Progress / Assigned to Done in Pydocstyle 2.1.1 Sep 3, 2017

@tovrstra

This comment has been minimized.

Copy link

tovrstra commented Sep 4, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment