Lint ispc on disk to solve include imprecisions
This commit is contained in:
parent
0b4507ed56
commit
9e8f2b0840
@ -140,7 +140,7 @@ formatting.
|
|||||||
| HCL | [terraform-fmt](https://github.com/hashicorp/terraform) |
|
| HCL | [terraform-fmt](https://github.com/hashicorp/terraform) |
|
||||||
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [prettier](https://github.com/prettier/prettier), [write-good](https://github.com/btford/write-good) |
|
| HTML | [alex](https://github.com/wooorm/alex) !!, [HTMLHint](http://htmlhint.com/), [proselint](http://proselint.com/), [tidy](http://www.html-tidy.org/), [prettier](https://github.com/prettier/prettier), [write-good](https://github.com/btford/write-good) |
|
||||||
| Idris | [idris](http://www.idris-lang.org/) |
|
| Idris | [idris](http://www.idris-lang.org/) |
|
||||||
| ISPC | [ispc](https://ispc.github.io/) |
|
| ISPC | [ispc](https://ispc.github.io/) !! |
|
||||||
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [google-java-format](https://github.com/google/google-java-format), [PMD](https://pmd.github.io/), [javalsp](https://github.com/georgewfraser/vscode-javac), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
| Java | [checkstyle](http://checkstyle.sourceforge.net), [javac](http://www.oracle.com/technetwork/java/javase/downloads/index.html), [google-java-format](https://github.com/google/google-java-format), [PMD](https://pmd.github.io/), [javalsp](https://github.com/georgewfraser/vscode-javac), [uncrustify](https://github.com/uncrustify/uncrustify) |
|
||||||
| JavaScript | [eslint](http://eslint.org/), [flow](https://flowtype.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [prettier](https://github.com/prettier/prettier), [prettier-eslint](https://github.com/prettier/prettier-eslint-cli), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
| JavaScript | [eslint](http://eslint.org/), [flow](https://flowtype.org/), [jscs](http://jscs.info/), [jshint](http://jshint.com/), [prettier](https://github.com/prettier/prettier), [prettier-eslint](https://github.com/prettier/prettier-eslint-cli), [prettier-standard](https://github.com/sheerun/prettier-standard), [standard](http://standardjs.com/), [xo](https://github.com/sindresorhus/xo)
|
||||||
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
| JSON | [fixjson](https://github.com/rhysd/fixjson), [jsonlint](http://zaa.ch/jsonlint/), [jq](https://stedolan.github.io/jq/), [prettier](https://github.com/prettier/prettier) |
|
||||||
|
@ -4,14 +4,11 @@
|
|||||||
call ale#Set('ispc_ispc_executable', 'ispc')
|
call ale#Set('ispc_ispc_executable', 'ispc')
|
||||||
call ale#Set('ispc_ispc_options', '')
|
call ale#Set('ispc_ispc_options', '')
|
||||||
|
|
||||||
" ISPC has no equivalent of gcc's -iquote argument, so use a -I for headers
|
|
||||||
" in the same directory. Not perfect, since now local headers are accepted
|
|
||||||
" by #include<> while they should not, but better than nothing.
|
|
||||||
function! ale_linters#ispc#ispc#GetCommand(buffer) abort
|
function! ale_linters#ispc#ispc#GetCommand(buffer) abort
|
||||||
return '%e '
|
return '%e'
|
||||||
\ . '-I ' . ale#Escape(fnamemodify(bufname(a:buffer), ':p:h'))
|
|
||||||
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
\ . ale#Pad(ale#c#IncludeOptions(ale#c#FindLocalHeaderPaths(a:buffer)))
|
||||||
\ . ale#Pad(ale#Var(a:buffer, 'ispc_ispc_options')) . ' -'
|
\ . ale#Pad(ale#Var(a:buffer, 'ispc_ispc_options'))
|
||||||
|
\ . ' %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Note that we ignore the two warnings in the beginning of the compiler output
|
" Note that we ignore the two warnings in the beginning of the compiler output
|
||||||
@ -65,4 +62,5 @@ call ale#linter#Define('ispc', {
|
|||||||
\ 'executable_callback': ale#VarFunc('ispc_ispc_executable'),
|
\ 'executable_callback': ale#VarFunc('ispc_ispc_executable'),
|
||||||
\ 'command_callback': 'ale_linters#ispc#ispc#GetCommand',
|
\ 'command_callback': 'ale_linters#ispc#ispc#GetCommand',
|
||||||
\ 'callback': 'ale_linters#ispc#ispc#Handle',
|
\ 'callback': 'ale_linters#ispc#ispc#Handle',
|
||||||
|
\ 'lint_file': 1,
|
||||||
\})
|
\})
|
||||||
|
@ -437,7 +437,7 @@ Notes:
|
|||||||
* HCL: `terraform-fmt`
|
* HCL: `terraform-fmt`
|
||||||
* HTML: `alex`!!, `HTMLHint`, `proselint`, `tidy`, `prettier`, `write-good`
|
* HTML: `alex`!!, `HTMLHint`, `proselint`, `tidy`, `prettier`, `write-good`
|
||||||
* Idris: `idris`
|
* Idris: `idris`
|
||||||
* ISPC: `ispc`
|
* ISPC: `ispc`!!
|
||||||
* Java: `checkstyle`, `javac`, `google-java-format`, `PMD`, `javalsp`, `uncrustify`
|
* Java: `checkstyle`, `javac`, `google-java-format`, `PMD`, `javalsp`, `uncrustify`
|
||||||
* JavaScript: `eslint`, `flow`, `jscs`, `jshint`, `prettier`, `prettier-eslint`, `prettier-standard`, `standard`, `xo`
|
* JavaScript: `eslint`, `flow`, `jscs`, `jshint`, `prettier`, `prettier-eslint`, `prettier-standard`, `standard`, `xo`
|
||||||
* JSON: `fixjson`, `jsonlint`, `jq`, `prettier`
|
* JSON: `fixjson`, `jsonlint`, `jq`, `prettier`
|
||||||
|
@ -6,22 +6,15 @@ After:
|
|||||||
|
|
||||||
Execute(The executable should be configurable):
|
Execute(The executable should be configurable):
|
||||||
AssertLinter 'ispc',
|
AssertLinter 'ispc',
|
||||||
\ ale#Escape('ispc')
|
\ ale#Escape('ispc') . ' %s'
|
||||||
\ . ' -I ' . ale#Escape(getcwd())
|
|
||||||
\ . ' -'
|
|
||||||
|
|
||||||
let b:ale_ispc_ispc_executable = 'foo'
|
let b:ale_ispc_ispc_executable = 'foo'
|
||||||
|
|
||||||
AssertLinter 'foo',
|
AssertLinter 'foo',
|
||||||
\ ale#Escape('foo')
|
\ ale#Escape('foo') . ' %s'
|
||||||
\ . ' -I ' . ale#Escape(getcwd())
|
|
||||||
\ . ' -'
|
|
||||||
|
|
||||||
Execute(The options should be configurable):
|
Execute(The options should be configurable):
|
||||||
let g:ale_ispc_ispc_options = '--foo'
|
let g:ale_ispc_ispc_options = '--foo'
|
||||||
|
|
||||||
AssertLinter 'ispc',
|
AssertLinter 'ispc',
|
||||||
\ ale#Escape('ispc')
|
\ ale#Escape('ispc') . ' --foo' . ' %s'
|
||||||
\ . ' -I ' . ale#Escape(getcwd())
|
|
||||||
\ . ' --foo'
|
|
||||||
\ . ' -'
|
|
||||||
|
Loading…
Reference in New Issue
Block a user