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

Idea: Show line number in source on error #33

Open
jdandrea opened this issue Feb 4, 2016 · 5 comments
Open

Idea: Show line number in source on error #33

jdandrea opened this issue Feb 4, 2016 · 5 comments
Projects
Milestone

Comments

@jdandrea
Copy link

jdandrea commented Feb 4, 2016

Is there a way to show line numbers (as kwalify does) and suppress traceback when validating using the CLI?

@Grokzen
Copy link
Owner

Grokzen commented Feb 4, 2016

Just to be sure what you mean, do you just want to supress the tracebacks on validation error and keep all other output? Or do you want to supress all output, you can do this with -q for quiet verbosity and it should silence all output.

When showing line numbers, where exactly do you want it? I do not really run the original kwalify so i can't see where it shows line numbers :]

@jdandrea
Copy link
Author

jdandrea commented Feb 4, 2016

Yes, I'd like to have the option to suppress (or permit?) tracebacks specifically and keep other output.

As for the line numbers, see this example.

Both of these would be a big help with user experience. If I can figure out the needed changes and issue a pull request, I'll be happy to do that too, but I wanted to ask first in case I'd be reinventing the wheel. Also: pykwalify has functionality kwalify doesn't (which I also like). :)

@Grokzen
Copy link
Owner

Grokzen commented Feb 5, 2016

To supress the traceback is something that is really easy to implement if -q is not enough.

The linenumber thing i am not so sure about how to implement because i am not aware of any support inside pyyaml to determine what line any key/value is sourced from. It would have to be investigated further if this is possible in pyyaml.

@jdandrea
Copy link
Author

jdandrea commented Feb 5, 2016

Ah, sounds good, and understood about the linenumber thing. Honestly, for me, the path is plenty. For folks who are used to going to line X and fixing something, then it becomes problematic, and that's where I'm trying to see if there's a way to do that. I imagine it's not trivial.

Keep it as a wish list item, perhaps? Not urgent, and maybe I'll be able to help figure it out. For the traceback suppression, I just realized a workaround, redirect stderr to /dev/null! :)

@Grokzen Grokzen changed the title No line numbers, traceback in CLI output Idea: Show line number in source on error Feb 5, 2016
@Grokzen
Copy link
Owner

Grokzen commented Feb 5, 2016

I changed the title of this and keep is as an idea. If i find some way to do this in a way that is not too complicated, i will give it a shot.

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

No branches or pull requests

2 participants