-
Notifications
You must be signed in to change notification settings - Fork 1
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
"Specific selector focused" algorithm #2
Conversation
Hello, thanks for the PR. Previously, if a correction could be suggested in one line, that was done. Example: _ = t.Embedded.Embedded Previously there was this output:
Now we have 2 different outputs.
Which, in my opinion, creates a lot of noise and makes it difficult to fix manually, and the more access to nested messages, the worse the output will be... Example_ = t.Embedded.Embedded.Embedded.Embedded.Embedded.Embedded
Do you have a solution to this problem? |
Please, reread more carefully my message above. |
This is a very common case in my projects, so I do not agree with the statement that the case is rare. Unfortunately, it's not that simple, which is why I didn't use |
As you wish. The most part of PR is suggestion from me, not requirement. Feel free to close PR and return back to critical points in the checklist. Or you could try to improve this with chain handling.
Thanks! |
Yes, you've given the impetus to rewrite and test it better. Thanks for the good ideas, I'll think about how to change the linter to make the code simpler. One question: do I understand correctly, in order to accept only 3 out of 4 commits from PR, I just need to cherry-pick? |
Or is it probably easier to accept all commits and then roll back one of them? I'm just not sure that cherry-peak, github will understand how to accept PR... |
I separated not-breaking part for you, mate |
Thank you very much! |
Related to #1.
Hello!
First of all, I want to say that I did not set out to rewrite your project. And of course not every linter gets such a complex review, I just liked your linter idea 🙂
I wanted to show what I meant in my comments. You can accept all or some or nothing. Maybe you can get some inspiration.
The main idea – KISS.
Comments to my commits:
Used full message in tests instead of mask. Otherwise it hides bugs, confuses test readers (like me), and prevents contributions to your code (how do I make sure I don't break anything?). critical
(p.s. if desired, you can go to test generation so as not to escape messages by hand, but use
regexp.QuoteMeta
)Changed message into a more grammatically correct form (from my point of view). I removed the quotes so that there is no conflict with string literals (otherwise we get escaping in the message). nitpicking, cosmetic
Simplified the code to the point of impossibility. As a result, the diagnostric message is now focused on a specific selector. Yes, it produces multiple messages for the chain of getters, but chain looks like a rare case that is still covered by
--fix
. nitpicking, cosmeticIgnore only protoc-generated files. Why?
--skip-dirs-use-default
list) by max. Also, you should not parse all the comments in the file, otherwise you can skip a regular file criticalAlso:
Further comments I will leave in issue.
Thank you for your patience! 💪