Skip to content
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(core): Add ignoreFile option #80

Merged
merged 5 commits into from Nov 2, 2022
Merged

feat(core): Add ignoreFile option #80

merged 5 commits into from Nov 2, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 31, 2022

This PR implements the ignoreFile option and rewrites the ignore option behaviour. Previously, we used glob's ignore option to pass an array of ignore rules to the library. This meant we'd get back a set of filtered files where ignore rules were already applied. However, glob does not support negated ignore rules, meaning ignore patterns like "ignore everything except file x" wouldn't work.

With this PR, we introduce a new library to the project: ignore. It lets us add rules to a rule checker (regardless of if these rules come from a file or an array). We now first collect all files with glob and subsequently filter out the ones that are ignored by the specified ignore rules. This rule checker supports all rules as specified in .gitignore specs. Therefore, it also supports negated ignore rules.

ref: #62

@Lms24 Lms24 marked this pull request as ready for review November 2, 2022 10:20
@Lms24 Lms24 requested a review from lforst November 2, 2022 10:20
@Lms24 Lms24 changed the title feat(core): Add ignoreFile option (Attempt) feat(core): Add ignoreFile option Nov 2, 2022
@Lms24 Lms24 enabled auto-merge (squash) November 2, 2022 10:49
@Lms24 Lms24 merged commit db04eb5 into main Nov 2, 2022
@Lms24 Lms24 deleted the lms-option-ignorefile branch November 2, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants