-
Notifications
You must be signed in to change notification settings - Fork 25
feat: ignore gitignore & bazleignore files #56
base: main
Are you sure you want to change the base?
Conversation
@Siddhant-K-code the CI job is failing. Could be on our end, can you confirm? |
I think, there is something wrong with the workflow. |
@slimsag any ideas? |
@@ -196,6 +196,11 @@ func GetIndex(ctx context.Context, dataDir, indexDataDir, projectName string, au | |||
return nil, errors.New("potentially malicious index name (this is likely a bug)") | |||
} | |||
|
|||
// ignore .gitignore or .bazelignore file | |||
if strings.Contains(indexName, ".gitignore") || strings.Contains(indexName, ".bazelignore") { | |||
return nil, errors.New("files to be ignored") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for this to be useful we would need to look at / parse the .gitignore
and .bazelignore
files, then ignore those files, no?
Also, I think strings.Contains
would be wrong here - we should ignore these at the time we produce the index, not inside of GetIndex
.
Probbaly it would need to live inside the IndexDir
methods of indexers themselves
doctree/doctree/indexer/indexer.go
Line 97 in 418506c
index, err := indexer.IndexDir(ctx, dir) |
but I'm not 100% sure right now, may not have much time on my end to find the best place for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah Yeah! This makes sense @slimsag
I will take a look at this 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @slimsag
permission to do so by an employer or client I am producing work for whom has this right.
fixes #33