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

Error feedback suggestions #127

Closed
siebrenf opened this issue Dec 6, 2021 · 1 comment
Closed

Error feedback suggestions #127

siebrenf opened this issue Dec 6, 2021 · 1 comment

Comments

@siebrenf
Copy link

siebrenf commented Dec 6, 2021

Hey team,

Here's a suggestion from a happy user!

Snakefmt seems to catch all issues and returns an error message. However, this message is too cryptic to be actionable. Take the error in this issue:

snakefmt.exceptions.InvalidPython: Got error:
'''
Cannot parse: 2:0:     var = "anything really"
'''
while formatting code with black.

The MRE is 4 lines (of code, 7 lines total), the error message contains code from line 7, but mentions 2:0. Seems there is a miscalculation to the original line number.
Additionally, if I were formatting multiple files at once, it gets even harder to pinpoint where the error occurred.

I would suggest changing the exception error to the following message:

snakefmt.InvalidPython in file /path/to/file.smk. Cannot parse line 7:0:      var = "anything really"

By stating filename and line number, users can find the issue more easily.
By changing from exception to message snakefmt would proceed with formatting other files. You could collect all warning messages until formatting is completed, then paste them all and exit with status 1.

@mbhall88
Copy link
Member

This should be improved in v0.6.1 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants