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

The checkpatch C checker doesn't show up the first time #1827

Closed vivien closed 8 years ago

vivien commented 8 years ago

In a linux repository, vim net/dsa/dsa.c then :SyntasticInfo shows:

Syntastic version: 3.7.0-168 (Vim 704, Linux)
Info for filetype: c
Global mode: active
Filetype c is active
The current file will be checked automatically
Available checkers: clang_check gcc make
Currently enabled checker: gcc

Running :SyntasticInfo a second time shows:

Syntastic version: 3.7.0-168 (Vim 704, Linux)
Info for filetype: c
Global mode: active
Filetype c is active
The current file will be checked automatically
Available checkers: checkpatch clang_check gcc make
Currently enabled checker: gcc

And checkpatch shows up.

Cc: @daniel-walker @d-k-c

lcd047 commented 8 years ago

I can't reproduce this, and I can't really imagine any non-catastrophic scenario of how it could happen. Either way, setting g:syntastic_c_checkpatch_exec explicitly to the full path of checkpatch or checkpatch.pl should fix the problem.

vivien commented 8 years ago

Setting g:syntastic_c_checkpatch_exec indeed fixes the checker detection. However the dynamic detection of ./scripts/checkpatch.pl is still broken. It doesn't seem like a special case to me, it happens for @d-k-c as well.

lcd047 commented 8 years ago

What do you mean by "dynamic"? What exactly did you do, what did you expect to happen, and what happened instead?

vivien commented 8 years ago

What do you mean by "dynamic"?

I mean what SyntaxCheckers_c_checkpatch_IsAvailable() does if g:syntastic_c_checkpatch_exec doesn't exist.

What exactly did you do, what did you expect to happen, and what happened instead?

You're basically asking to repeat my first comment. Clone a Linux repo, or do something like:

$ mkdir -p /tmp/test/scripts
$ touch /tmp/test/scripts/checkpatch.pl
$ chmod +x /tmp/test/scripts/checkpatch.pl
$ cd /tmp/test
$ vim test.c

I expect checkpatch to show up in the "Available checkers" list the first time I run :SyntasticInfo, but it doesn't.

lcd047 commented 8 years ago

I mean what SyntaxCheckers_c_checkpatch_IsAvailable() does if g:syntastic_c_checkpatch_exec doesn't exist.

It caches the first result until the exec changes. shrug

You're basically asking to repeat my first comment.

No, I was asking you to give more details about what you did, so I could make sense of what you're seeing. I suppose we were both wrong though, so I'll stop here.