-
Notifications
You must be signed in to change notification settings - Fork 293
Description
First of all, thanks for the amazing linter.
Background
I'm using cpplint as a neomake maker in my nvim, but the same behavior is observed when I use cpplint directly as a command line tool.
My file tree looks like this:
/Users/x/
| .git/
| repo/
| | project/
| | | .git/
| | | src/
Problem
When I work on /Users/x/repo/project/src/mylib.h
, cpplint tells me to use REPO_PROJECT_SRC_MYLIB_H_
for my header guard, so cpplint apparently thinks my repository is /Users/x/
(where the first .git/
lies), but the correct repository should be /Users/x/repo/project/
(where the second .git/
lies).
Unsurprisingly, the problem is gone when I append --repository=/Users/x/repo/project
, but this would require me to feed in different --repository
flags when working on different repositories. What's worse is that in my case where cpplint is used as a nvim plugin, I will have to edit my "nvimrc" (init.vim
) every time I switch repository. This definitely sounds wrong, or at least suboptimal.
Expected Behavior
When no --repository
flag is supplied, cpplint should figure out the correct repository path , i.e., /Users/x/repo/project
, "by searching for a path that contains .git, .hg, or .svn.", according to cpplint -h
.
I'm also interested in any workaround that separately figures out the repository path (using some other unix tools) and then sets --repository
for cpplint.