-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Configuration Files
This file exists only as a historic reference. Documentation for syntastic
checkers is now included in the manual, please see :help syntastic-checkers
in Vim.
Currently, the following checkers can read some of their options from configuration files:
- ada/gcc
- asm/gcc
- c/avrgcc
- c/clang_check
- c/clang_tidy
- c/cppcheck
- c/gcc
- c/oclint
- c/sparse
- c/splint
- cobol/cobc
- cpp/clang_check
- cpp/clang_tidy
- cpp/cppcheck
- cpp/gcc
- cpp/oclint
- cpp/verapp
- d/dmd
- fortran/gfortran
- objc/gcc
- objc/oclint
- objcpp/gcc
- objcpp/oclint
- verilog/verilator
Depending on the checker, the filename of the corresponding configuration file
can be specified by setting either g:syntastic_<filetype>_config_file
or
g:syntastic_<checker>_config_file
. See the checker's documentation in the
wiki for the exact name.
A configuration file is looked up in the directory of the file being checked, then upwards in parent directories. The search stops either when a file with the right name is found, or when the root of the filesystem is reached.
Consequently, you would normally put a configuration file in the top directory of your project, and you would override it when needed with other configuration files placed in subdirectories.
The file is expected to contain one option per line. Empty lines and lines
starting with #
are removed. On each line, leading and trailing spaces are
also removed. Each option is then escaped, so you don't have to worry about
special characters.
Lines starting with -I
are assumed to be include paths, and are handled
specially. If the path following an -I
is relative, it's treated as
being relative to the current configuration file, and is replaced by the
corresponding absolute path. If the path is absolute to begin with, it is
left unchanged.
Please note that, aside from -I
, syntastic doesn't try to keep track of
options with arguments. If you need to pass f.i. -aux-info filename
to your
compiler you have to write -aux-info
and filename
on separate lines in the
configuration file, otherwise syntastic will quote the space and merge them in
a single string, which is probably not what you mean:
-aux-info
filename
In the same vein, =
in options not special in any way. As stated
above, everything on a line (except lines starting with -I
, as noted)
is considered an "option" and escaped.