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

Give base IsMatch method a clearer signature? #18

Open
markashleybell opened this issue Sep 1, 2020 · 3 comments
Open

Give base IsMatch method a clearer signature? #18

markashleybell opened this issue Sep 1, 2020 · 3 comments

Comments

@markashleybell
Copy link
Owner

markashleybell commented Sep 1, 2020

Currently we have public bool IsMatch(string path, bool pathIsDirectory), but it does cause a bit of "boolean blindness" unless you label the parameter... for example, without looking at the source, what does the second parameter mean in this case?

rule.IsMatch(directory.FullName, true);

Might be nicer to either replace it with an enum, or make that method internal (or even private) and add IsFileMatch and IsDirectoryMatch methods, so it's really explicit?

@markashleybell
Copy link
Owner Author

This would obviously be a breaking change, so would need to be part of the next major version bump.

@nojaf
Copy link
Contributor

nojaf commented Sep 1, 2020

Perhaps you can introduce the new methods as a part of a minor and mark the current IsMatch as deprecated but keep it as a facade thing.

@markashleybell
Copy link
Owner Author

Good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants