-
Notifications
You must be signed in to change notification settings - Fork 23
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
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