-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add checker for sqlint (https://github.com/purcell/sqlint) #1477
Conversation
Nice project, and reasonably clean implementation of the checker. However, I don't think the licence you chose, GPLv3, is compatible to the license of syntastic, WTFPL. shrug |
@lcd047 We've changed the sqlint checker license to MIT, but in any case that's the license for the checker, not for the syntastic plugin code, so I don't think license compatibility is a concern. |
Oh, hang on - I see what you mean. Let me fix that. |
Updated - sorry for the confusion. :-) |
I was referring to the license of the syntastic plugin code for which you sent the pull request. The license of |
@lcd047 Yep, gotcha - that's fixed now. |
Ok, thank you. Can you please post a few code snippets that produce multiline messages, preferably both errors and warnings? |
Sure:
Which produces
We don't have WARNING examples yet, because we need to work with the upstream project which does the heavy lifting for the parsing, but the format will be identical apart from the |
Thank you, I think I have everything I need. On a side note however, including pieces of the source in the error messages without sanitising them first seems like a really bad idea, see f.i. #1435 for the kind of problem this can cause for syntastic. |
Hmm, I thought that using the double-space prefix for all continuation lines would be sufficient sanitisation to make the output unproblematic, since presumably the filename matches are anchored to the line start positions. |
The behaviour in #1435 appeared to be due to a raw newline in the error string, but in our error strings those newlines would still result in indented lines. |
Yes. Now think of a terminal control code instead of a newline. Unrelated: the offset reported seems to be off by one. F.i. |
Ok, merged with this patch on top: 1e475a7 |
That may be handled by the underlying parsing library, which is the C PostgreSQL query parser, but I'll investigate and make sure that gets handled.
Pretty sure it's correct as-is. The line and column numbers and one-based, like most linters. I definitely see the correct positions in vim with syntastic and this checker definition. |
It's probably a good idea to either kill or replace all characters < 0x20 except tab, just to be safe.
Syntastic correctly highlights the space before |
Ah, there's a 0.0.4 already. That offset was one thing that got fixed. Sorry for not guessing faster at the likely problem. |
Version 0.0.5 (just released) fixes the control character loophole by printing them safely as escapes, e.g. |
Nuch better, thank you. :) Ok, highlighting should be nicer now too: d353962 |
Great! |
Needless to say, thanks for your help and patience. I hesitate to admit it, but I'm an Emacs guy these days, but I wanted to make sure vim users could benefit from |
Hi! This PR adds a new syntastic checker definition for the
sqlint
linter (https://github.com/purcell/sqlint). The checker definition is based on a couple of existing syntastic checkers: please let me know if anything needs fixing up. Cheers!