-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 validation hook to configuration parsing #5824
Conversation
Here's an example of your CHANGELOG entry: * Add validation hook to configuration parsing.
[SimplyDanny](https://github.com/SimplyDanny)
[#issue_number](https://github.com/realm/SwiftLint/issues/issue_number) note: There are two invisible spaces after the entry's text. Generated by 🚫 Danger |
72f1ed5
to
81440d7
Compare
@mildm8nnered, could you have a look? |
@@ -3,7 +3,7 @@ import Foundation | |||
/// All possible SwiftLint issues which are printed as warnings by default. | |||
public enum Issue: LocalizedError, Equatable { | |||
/// The configuration didn't match internal expectations. | |||
case invalidConfiguration(ruleID: String) | |||
case invalidConfiguration(ruleID: String, message: String? = nil) |
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.
I wonder if we could help the reader more with distinguishing between invalid rule configurations, and invalid swiftlint configurations (if you consider those to be different things) - invalidRuleConfiguration
although I guess that is implied by ruleID
). There are some other issues where we could also make that distinction if we wanted to.
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.
Absolutely, I'm always a fan of tools providing clear feedback. This one can only be used inside of rules due to the ruleID
parameter which is not otherwise available.
Might be good to include an "example" implementation of validate for an actual rule ... |
#5781 is going to be the first candidate. |
No description provided.