Exclude some folder / files from `.cody/ignore`

request for a help with cody ignore feature.

I want to ignore a folder Library/ but want to exclude from ignore a folder inside it : Library/PackageCache

Is there any way to do this?

1 Like

Any updates here? Guys?

Hi @wellmorq did you follow these instructions?

Hi!
What do you mean? There are no instructions on how to exclude a folder from an excluded folder.

By the way, is it .cody/ignore or .codyignore? The instructions talk about both options.

It seems that in the docs provided there is a typo. In the paragraph it means .cody/ignore instead of .codyignore

So please create a folder .cody at the root path of your project in which you create a file called ignore. In this file you provide the files and folder as relative path to your project root directory which should be ignored.

1 Like

Gotcha!
Maybe you know something about the second question?

I want to exclude folder /Library.
But
not to exclude the folder /Library/PackageCache
Right now I haven’t seen the docs on how I can make it.

I guess it works similar like gitignore. For folders not excluded as a whole you need to explicitly define which sub-folders should be excluded and which not.

- Library (pass)
-- Folder1 (excluded)
-- Folder2 (pass)
-- Folder3 (excluded)

Maybe glob patterns are working, but I don’t know for sure.
If this solution does not work for your use case, maybe you can split your Library folder into excluded and included.

Nope, it doesnt work :frowning:
For gitignore I have to use such syntax:

[Ll]ibrary/
[Tt]emp/

*.csproj

// and for exclude from excluded:
![Ll]ibrary/PackageCache

But it doesn’t work with Cody:

image

I only hope the *.meta syntax will at least work.

I guess RegEx is not supported.
You need to exclude files and folders literally.

The Library folder created by codegen via source engine (Unity). And it contains >100 folders and a lot of files where I need exclude-from-exclude the only one.

I suppose I could write a script that would populate the file each time before running Cody.

It’s not very convenient, but as a workaround…
Let’s see how Cody’s indexing algorithm reacts, I’m very worried that it will either not trigger when a file changes (as it did before) and files will not be excluded, or absolutely all files will be excluded.

Or it will trigger every time and that means re-indexing every day for 5-6 hours. Ok, I can start my PC 5-6 hours earlier.

I just hope Cody doesn’t freak out if I have thousands of lines in this file. Cody is definitely not well suited for large projects :frowning:

Anyway, thx for the reply and trying to help! I’m really appreciate this

If you type Library/PackageCache won’t this exclude only this folder and passes all other folders along?

Would it help if you could toggle directly in the file explore of VS Code to exclude/include folders and files?

Of course, that would be super convenient.

The thing is, I want Cody to keep processing the Library/PackageCache. But exclude absolutely all other files and folders.

Perhaps a better option would be to just follow the .gitignore formatting rules completely. I.e. !Library/PackageCache/ for example to exclude, etc.

Seems like that would be easier to both do and maintain, and it would cause a lot less questions.

1 Like