Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

feat: ignore gitignore & bazleignore files #56

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Siddhant-K-code
Copy link

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received
    permission to do so by an employer or client I am producing work for whom has this right.

fixes #33

@jdorfman
Copy link
Member

@Siddhant-K-code the CI job is failing. Could be on our end, can you confirm?

@jdorfman jdorfman self-assigned this Aug 29, 2022
@Siddhant-K-code
Copy link
Author

I think, there is something wrong with the workflow.
See this

@jdorfman jdorfman requested a review from slimsag August 30, 2022 19:53
@jdorfman
Copy link
Member

@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")
Copy link
Member

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

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.

Copy link
Author

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 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @slimsag

@Siddhant-K-code Siddhant-K-code marked this pull request as draft August 31, 2022 18:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respect ignored files (.gitignore)
3 participants