Can't ignore .eunit folders
sedrik opened this issue · 12 comments
I would like to leave .eunit test folders out of the tags file.
I have tried
let g:erlang_tags_ignore = "/.eunit/"
let g:erlang_tags_ignore = ".eunit/"
But I still get .eunit beam files in my tags.
@sanmiguel, could you have a look at it? Thank you.
Writing ".eunit/" will only ignore the .eunit directory below the current directory, not all .eunit directories recursively.
To ignore all .eunit directories, you need to specify wildcards:
let g:erlang_tags_ignore = "**/.eunit"
Does this solve the problem?
sadly it does not, tried removing the tags file completely and re-generating it to no success. The eunit test beams are still there.
sadly it does not, tried removing the tags file completely and re-generating it to no success.
It overwrites the tags file, even if there is one, so you don't have to remove it each time.
The eunit test beams are still there.
Hm, what do you mean by "beams"? The input of vim-erlang-tags is the Erlang source files, and the output is the TAGS file containins tags.
A few questions:
- Have you added the
let g:erlang_tags_ignore = "**/.eunit"line to your vimrc? - Have you restarted Vim afterwards?
- If you type
:pwdin Vim, what is the current directory? What is the full path to the .eunit directory that you are trying to ignore? Is the former one a prefix of the former one?
Ofcourse I ment the erlang source files reference (to stuff that eunit stores in .eunit)
Here is a small video showcasing my issue
http://asciinema.org/a/6034
It should be reproducible.
Nice video 👍
-
What happens if you invoke he script manually? That is:
/path/to/vim-erlang-tags.erl --ignore '**/.eunit'and also
/path/to/vim-erlang-tags.erl --ignore .eunit(The latter should work too, because your
.eunitis in the main project directory.) -
Which commit of vim-erlang-tags are you using? (
git log -n1will tell you.) -
Which operating system do you use?
-
Which Erlang version do you use?
-
Which Vim version do you use? (
:version, first line)
/path/to/vim-erlang-tags.erl --ignore .eunit
Gives me the desired output. Using '**/.eunit' does not.
Version information:
git log -n1
commit e70acec
Merge: 17f4cb5 800deee
Author: Csaba Hoch csaba.hoch@erlang-solutions.com
Date: Thu Oct 10 15:36:37 2013 +0200
Merge remote-tracking branch 'origin/master'
Ubuntu 13.04
Erlang R15B01
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 2 2013 09:17:34)
It seems that this is related to how the argument is passed to the script when wildcards are concerned.
OK, I found out why the ** version does not work. Erlang R15 does not support ** as a wildcard, only R16 does. (See R15B/filelib:wildcard vs R16B/filelib:wildcard.) I didn't notice this because I use R16.
That means that the let g:erlang_tags_ignore = ".eunit/" version should still work (even with R15), as long as it is in the main project directory.
The commit is the correct one, and the Ubuntu and Vim versions also seems fine. (I tried Vim 7.3 and worked.)
ok, I switched to R16B02 but I am still unable to get something like apps/**/.eunit to work.
ignoring .eunit works just fine but I would need the wildcard expansion as well as we use that structure in our work repository. Did you manage to get that to work as well?
ignoring .eunit works just fine but I would need the wildcard expansion as well as we use that structure in our work repository. Did you manage to get that to work as well?
Yes, let g:erlang_tags_ignore = "apps/**/.eunit/" works for me.
How about the command line version (/path/to/vim-erlang-tags.erl --ignore 'apps/**/.eunit') now, with R16?
Calling the script directly does work fine (then **/.eunit works which is perfect) however doing it from inside vim still gives me .eunit folders in the tags file.
I did some extensive testing with echom and found that the reason it breaks down is because of how I handle pathogen setups.
I will open a pull reqest where I describe my setup and how the fix works. We can continue any discussion there.
I found another property of --ignore which might be confusing.
Compare the followings:
vim-erlang-tags apps --ignore '**/.eunit'
vim-erlang-tags ./apps --ignore '**/.eunit'
Only the second one works as expected, because (at least on my machine) **/.eunit is expanded to ["./apps/myapp/.eunit"], but while traversing the directory tree we see this directory as ["apps/myapp/.eunit"] (there is no ./), hence we don't ignore it.