-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add Rule.filterErrorsForFiles #115
Conversation
I've switched to using I'm not sure what to do about the conflict in the PR. When pulled, the code shows |
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.
This is looking pretty good @jiegillet, thanks a lot for your work!
I have a few comments, feel free to let me know if you disagree or have better solutions in mind. As for the docs.json
file, make sure you're rebased on top of master
, and then just re-generate the file to overwrite it. As for the multiline thing, it should be on one line. My guess is that you may have manually saved (and therefore reformatted it) in your editor maybe(?) in your previous PR about typos.
Co-authored-by: Jeroen Engels <jfm.engels@gmail.com>
add6f56
to
ffc2fad
Compare
All comments addressed (and fixed CI failure), thank you for the review! The issue with the docs is that |
Actually it should be on one line. The multiline was introduced in #116 and I hadn't noticed it. I'm wondering about the naming of this function. Since this function applies a predicate on files, not errors, I don't think it makes sense to call it |
Ah! #116? Then it's my fault, sorry -_- |
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.
Sorry for the delay @jiegillet
Thanks a lot for your hard work here 🙏
This is now released in v2.7.0! |
As discussed on Slack, here is my proposal for adding
Rule.onlyAllowErrorsForSpecifiedDirectories
andRule.onlyAllowErrorsForSpecifiedFiles
.When used several times, it adds to an internal list of "specified" files/directories, I tried to find a name that reflected that, that's why it ended up being a bit verbose. I considered other options, like taking the intersections of specified files, but in that case, rules would run on less files and have less chance of being noticed if several instances of
nlyAllowErrorsForSpecified*
were used independently by mistake.When used in combination with
ignoreErrorsFor*
it still only allows the specified locations and then ignore files from those.I ended up reverting the internal logic in
Exceptions
(renamedaddFiles
asignoreFiles
) because it was confusing.I didn't feel a need to add configuration errors, in this case, the worst that can happen is people ignoring files that are not allowed anyway. In any case, I'm happy to discuss more and make changes if the API doesn't feel natural to use, or if my code can be improved.