You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We consider using error in fromString acceptable because there is no other way to signal failure and it's (as long as we're disciplined) used only on literals we control. So I would like to tell HLint to ignore the error lint specifically in any function named fromString. Seems easy, but I can't make it work.
# I confirmed this works, just to make sure my config is being respected
- ignore: {name: "Avoid error"}# This also works, but is too broad
- ignore: {name: "Avoid error", within: "Example.Whatever"}# This does not work
- ignore: {name: "Avoid error", within: "fromString"}# This does not work either
- ignore: {name: "Avoid error", within: "**.*.fromString"}# Nor this
- ignore: {name: "Avoid error", within: "Example.Whatever.fromString"}# Or this
- ignore: {name: "Avoid error", within: "Example.Whatever.IsString.fromString"}# Or this
- ignore: {name: "Avoid error", within: "Example.Whatever.IsString"}
I'm assuming it's the fact that it's a class function and not a normal top-level. Is that it? Is there any way to do what I'm after here?
The text was updated successfully, but these errors were encountered:
We have a few
IsString
instances that use some safe conversion function anderror
on invalid input:But we also have a rule to avoid
error
generally, which this trips over:We consider using
error
infromString
acceptable because there is no other way to signal failure and it's (as long as we're disciplined) used only on literals we control. So I would like to tell HLint to ignore theerror
lint specifically in any function namedfromString
. Seems easy, but I can't make it work.I'm assuming it's the fact that it's a class function and not a normal top-level. Is that it? Is there any way to do what I'm after here?
The text was updated successfully, but these errors were encountered: