Skip to content
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

Pymode silently swallows linting errors #859

Closed
sruggier opened this issue Feb 22, 2018 · 2 comments
Closed

Pymode silently swallows linting errors #859

sruggier opened this issue Feb 22, 2018 · 2 comments
Labels

Comments

@sruggier
Copy link

Hi, before I report anything, I'd like to thank anyone reading this for helping with python-mode, it's very helpful.

My .vimrc file has historically contained this:

" Don't complain about missing docstrings, but if one exists, validate it.
let g:pymode_lint_ignore = "D100,D101,D102,D103"

I updated python-mode, and the linting stopped working. A quick bisect led me to commit 76c582b, which immediately explained to me what I needed to fix in my vimrc. While searching for duplicates, I also noticed that if I add let g:pymode_debug = 1, I can see the ValueError and a traceback for about a second every time linting is run, which is just about enough time to take a screenshot and run tesseract on it:

[Pymode] Code checking is running ...
1519330549 ['pyflakes', 'pepB', 'mccabe', 'pep257'] []
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "path/to/python-mode/pymode/lint.py", line 38, in code_check
    raise ValueError ('g:pymode_lint_ignore should have a list type')
ValueError: g:pymode_lint_ignore should have a list type

However, a user shouldn't have to know about either of these things to find out that a variable has been set incorrectly. The current behaviour of silently breaking with no useful information is relatively unhelpful. Instead of telling the user that the code has no errors, the lint execution should propagate the exception to the user so they can troubleshoot effectively.

@diraol
Copy link
Contributor

diraol commented Feb 24, 2018

Hi @sruggier , thanks for your contribution here =)

I am still understanding how python-mode works, but I am not sure about is the best approach for python-mode. If it propagates all exceptions without the debug flag, it may make vim unusable for users with "bad configs". The same may go for all plugins. Imagine if all plugins throw away every error and exception....
Moreover, this is why the debug mode exists.
May be the debug mode showing the error for a quick time window can be improved, but we have the troubleshooting session on our readme to help users debug such kind of error without the need to take a screenshot and use tesseract....

@stale
Copy link

stale bot commented Jul 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the inactive label Jul 24, 2018
@diraol diraol closed this as completed Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants