Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no easy way to specify additional parameter (include directory) to the linter #603

Closed
zhou13 opened this issue Sep 10, 2016 · 3 comments

Comments

@zhou13
Copy link

zhou13 commented Sep 10, 2016

In a C++ project, it is common that we need to specify the include directory using-Iinclude. Currently, there is no easy way to do this unless we ignore the default maker and write our own. Even by doing this, it is hard to achieve per-project control of the include directory.

Plugins such as YCM and deoplete-clang provides per-project configuration file such as .ycm_extra_conf.py and .clang. It can be much more convenient if neomake has the similar feature.

@davidosomething
Copy link
Contributor

something like

autocmd BufRead ~/projects/myproject/*
    \   let b:includes = '~/projects/myproject/includes'
    \ | let b:neomake_cpp_mylinter_args = [ '-Iinclude' . b:include_directory ]

might be what you're looking for. Maybe look into project specific/relative vimrc files, in conjunction.

I've actually done something similar in which I run the phpcs linter with special args just for WordPress projects (non-wordpress projects will use the default phpcs args):

https://github.com/davidosomething/dotfiles/blob/master/vim/plugin/plug-neomake.vim#L177-L184

@zhou13
Copy link
Author

zhou13 commented Sep 10, 2016

I don't like idea to hard code any path in my vimrc. I actually solved it using something similar using lvimrc. However I still hope this should be natively supported.

@blueyed
Copy link
Member

blueyed commented Sep 11, 2016

Check out https://github.com/embear/vim-localvimrc, which allows for a .lvimrc file for your project.

But I agree that we should be able to pass in arguments to makers.
I am going to close it as duplicate of #589 for now. There are references to other issues in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants