vim-syntastic / syntastic

Syntax checking hacks for vim
Do What The F*ck You Want To Public License
11.3k stars 1.14k forks source link

W3C HTML5 checker not reporting errors #1151

Closed benfrain closed 10 years ago

benfrain commented 10 years ago

I'm running Syntastic on Vim 7.4 CLI (Mac OS 10.9) and I have added the following to my .vimrc:

let g:syntastic_html_checkers = ['w3']

As per the WIKI docs.

However, I don't get HTML errors flagged up on save (for example if I nest an <a> tag in a <button>), nor do I get any errors to say the checker isn't working.

Am I doing something obviously incorrect?

lcd047 commented 10 years ago

Please open a HTML file, run :SyntasticInfo, and post the output.

benfrain commented 10 years ago

OK, here it is:

Syntastic: active mode enabled
Syntastic version: 3.4.0-93
Info for filetype: html
Available checker(s): tidy validator w3
Currently enabled checker(s): w3
lcd047 commented 10 years ago

Ok. Please open the file with errors, set g:syntastic_debug to 3, run the checker, and post the output of :mes.

benfrain commented 10 years ago

OK, I used let g:syntastic_debug = 3 in my vimrc, entered an obvious error in my HTML and then saved and this little lot popped up:

syntastic: 3.680556: g:syntastic_version = '3.4.0-93'
syntastic: 3.680720: &shell = '/bin/bash', &shellcmdflag = '-c', &shellpipe = '2>&1| tee', &shellquote = '', &shellredir = '&>', &shellslash = 0, &shelltemp = 1, &shellxquote = '', &shellxesc
ape = ''
syntastic: 3.680911: g:syntastic_aggregate_errors = 0
syntastic: 3.681066: getcwd() = /Users/benfrain/Sites/
syntastic: 3.683608: CacheErrors: Invoking checker: html/w3
syntastic: 3.683847: SyntasticMake: called with options: {'errorformat': '%A %\+{,%C %\+"lastLine": %l\,%\?,%C %\+"lastColumn": %c\,%\?,%C %\+"message": "%m"\,%\?,%C %\+"type": "%trror"\,%\?,
%-G %\+"type": "%tnfo"\,%\?,%C %\+"subtype": "%tarning"\,%\?,%Z %\+}\,,%-G%.%#', 'defaults': {'bufnr': 3}, 'makeprg': 'curl -s -F output=json -F uploaded_file=@/Users/benfrain/Sites/test.html\;type=text/html http://validator.w3.org/check', 'returns': [0]}
syntastic: 3.707748: checker output: ['']
syntastic: 3.708351: raw loclist: []
syntastic: error: checker html/w3 returned abnormal status 6
syntastic: 3.708968: html/w3 raw: []
syntastic: 3.709281: quiet_messages filter: {}
syntastic: 3.709717: aggregated: {'_name': '', '_rawLoclist': [], '_owner': 3}
lcd047 commented 10 years ago

syntastic: error: checker html/w3 returned abnormal status 6

That's curl's error 6 "Couldn't resolve host. The given remote host was not resolved". DNS problem, or (more likely) curl linked against the wrong resolver.

lcd047 commented 10 years ago

BTW, that should also have beeped at you. :)

benfrain commented 10 years ago

OK, forgive me but this is a little beyond my comprehension. Is there something I should do to resolve the curl issue? How does it get linked against the wrong resolver?

Sorry, when you say beeped at me - can you elaborate?

lcd047 commented 10 years ago

Is there something I should do to resolve the curl issue? How does it get linked against the wrong resolver?

Basically, curl was compiled with the wrong options. If you didn't compile curl yourself, you should file a bug report to the relevant forum for your OS. The exact command that produced the error is makeprg above:

curl -s -F output=json -F uploaded_file=@/Users/benfrain/Sites/test.html\;type=text/html http://validator.w3.org/check

If you run this in a terminal, it returns exit code 6 instead of 0.

Sorry, when you say beeped at me - can you elaborate?

When curl exits with a non-zero code, Vim is supposed to beep and print an error message. But various terminals helpfully disable the beep, and the error message may have scrolled up so you didn't notice it.

benfrain commented 10 years ago

I'm on Mac OSX 10.9 so I'll Google around and see if I can find out why it's not set up correctly. Thanks for the help.

lcd047 commented 10 years ago

After some digging through the curl code, my understanding is that error 6 can also happen as a result of a "normal" DNS timeout. Various other sections of the w3.org site had scaling problems recently, so the problem might actually be on w3's side. Either way, it isn't related to syntastic though. Once you can get the above curl command to run without error in a terminal, you should also see the messages in syntastic.

benfrain commented 10 years ago

I imagine it must be curl in someway as the validator.nu checker fails to.

The standard (non HTML5) checker works fine.

On 30 Jul 2014, at 17:50, LCD 047 notifications@github.com wrote:

After some digging through the curl code, my understanding is that error 6 can also happen as a result of a "normal" DNS timeout. Various other sections of the w3.org site had scaling problems recently, so the problem might actually be w3's side. Either way, it isn't related to syntastic though. Once you can get the above curl command to run without error in a terminal, you should also see the messages in syntastic.

— Reply to this email directly or view it on GitHub.