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

simplify design #11

Closed
wants to merge 9 commits into from
Closed

simplify design #11

wants to merge 9 commits into from

Conversation

septs
Copy link
Contributor

@septs septs commented Jul 25, 2020

Convenient preset rules

gitignore.Combine(
    gitignore.FromLines(".", []string{".DS_Store", "License.nfo"}),
    gitignore.FromLines("./foo", []string{"*.dng"}),
    gitignore.FromLines("./foo/bar", []string{"*.log"}),
    // ... user ignore patterns ...
)

closes #10

@septs
Copy link
Contributor Author

septs commented Jul 25, 2020

I think the method name can be shortened:

Original method name New method name Actual use
NewGitIgnore FromFile gitignore.FromFile
NewGitIgnoreFromReader FromReader gitignore.FromReader
NewGitIgnoreFromLines FromLines gitignore.FromLines

@septs septs changed the title simplify built gitignore design simplify design Jul 25, 2020
@septs
Copy link
Contributor Author

septs commented Jul 26, 2020

New feature:

gitignore.NewFromFile("to/your/.ignore", "to", "your")
// eq
gitignore.NewFromFile("to/your/.ignore", filepath.Join("to", "your"))

@septs
Copy link
Contributor Author

septs commented Sep 26, 2020

@monochromegane

@monochromegane
Copy link
Owner

Thank you for your suggestion.
But I have no plans to change the interface so far.

@septs septs deleted the patch-1 branch September 26, 2020 09:29
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.

Combine multiple ignore files
2 participants