-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs: fix pattern of forbidigo in example config yaml #2000
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
Conversation
Hey, thank you for opening your first Pull Request ! |
|
Maybe it just worth mentioning that pattern should be a valid regular expression? |
I think that we need to encourage user to use valid regular expression because I think the biggest problem is that there are patterns in the documentation that don't work. Based on the above, here's what I think is a good example.
|
Absolutely agree! How about:
- fmt.Print
- 'fmt\.Print.*'
- '^fmt.Print.*$' |
@butuzov I understand the idea, but it can be confusing for users to use 3 variations of the same expression. I would prefer: forbidigo:
# Forbid the following identifiers
forbid:
- ^print.*$
- 'fmt\.Print.*'
|
Can we leave at least one simplified pattern? |
There no real simplified pattern: a dot in a regex doesn't mean dot but every character. ex: |
... and |
Compare it to the |
I agree with adding a comment about the regex syntax requirement. 👍 |
I've modified it based on your opinions. |
my suggestion deleted, As pointed @ldez it wasn't based on right commit. Here is what I was suggesting (to move test to main linter block above + # Forbid the following identifiers (identifiers are written using regexp):
- # Forbid the following identifiers
forbid: |
Hey, @ytakaya — we just merged your PR to
By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests. Thanks again! |
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.
👍
The pattern of forbidigo in
.golangci.example.yaml
was not the correct pattern so I fixed.It has been modified with reference to the original usage.
ginkgo\\.F.*
in the pattern before modification does not behave as expected.