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

Filename-format rule: fix filename extension regex: ".go" to "\\.go". #1132

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

denarced
Copy link
Contributor

Just a quick fix for an obvious issue with the filename regex. Filename extension's dot wasn't escaped so, for example, "awesome$go" was considered a valid filename.

Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, but a file naned awesome$go, won't be a go files, so something that revive would catch, no?

I mean the regex wasn't perfect, and you are fixing it. Thank you about that.

But it was a crime without victim, right ?

@denarced
Copy link
Contributor Author

True, very hard to find a victim. I've seen this type of slip-ups (not escaping filename extension dots in regex) many times before and in all cases, no one ever found the defect in production. I don't know the project so there was a chance that the fix was somehow useful, it was suppose to be quick (it actually wasn't), so I just fixed it. If I ended up breaking something, please just revert the commit :).

@ccoVeille
Copy link
Contributor

I'll let other people provide feedbacks.

But for me, you "bug fix" is legitimate

@chavacava
Copy link
Collaborator

Hi @denarced, thanks for the fix.

@chavacava chavacava merged commit dff4dc9 into mgechev:master Nov 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants