Closed Tommi2Day closed 8 months ago
@Tommi2Day Thanks for sharing this.
Does that IDE offer an option to automatically fix the regex patterns or an alternative?
partially yes. You can go through the positions complained and add "suggested Action"
this is a version with all suggestions adopted. Unit test ran sucessfully
digitOrInfinity := regexp.MustCompile(
[\d~]
) optionalInvertAndRange := regexp.MustCompile(^@?([-+]?[\d.]+(?:e[-+]?[\d.]+)?|~)?(:([-+]?[\d.]+(?:e[-+]?[\d.]+)?)?)?$
) firstHalfOfRange := regexp.MustCompile(^([-+]?[\d.]+(?:e[-+]?[\d.]+)?)?:
) endOfRange := regexp.MustCompile(^[-+]?[\d.]+(?:e[-+]?[\d.]+)?$
)
@Tommi2Day Thanks for sharing. That linting feature looks like it would really come in handy.
just to let you know Jetbrains Goland raises serveral RegExp warnings in range.go, which are causing force commits with changed code