elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.52k stars 296 forks source link

chore: fix function names in comment #1787

Closed goodfirm closed 2 months ago

krader1961 commented 2 months ago

This looks fine to me but I'm curious how you found these errors. Is this something that can be automated as a lint check that reports such errors? Such as those done by make most-checks.

goodfirm commented 2 months ago

This looks fine to me but I'm curious how you found these errors. Is this something that can be automated as a lint check that reports such errors? Such as those done by make most-checks.

Thank you for your reply. At present, there is no relevant Lint. I obtained it locally by parsing the ast and manually selecting it

krader1961 commented 2 months ago

Thank you for your reply. At present, there is no relevant Lint. I obtained it locally by parsing the ast and manually selecting it

I am curious if you are you working on creating a tool similar to goimports or gofmt that automates detection of documentation errors such as those fixed by this pull-request. Such a tool would have immense value if the false positives can be kept to zero so that it only reports actual documentation errors that need correction. But even if your tool has a small number of false positives it could still be useful.

goodfirm commented 2 months ago

Thank you for your reply. At present, there is no relevant Lint. I obtained it locally by parsing the ast and manually selecting it

I am curious if you are you working on creating a tool similar to goimports or gofmt that automates detection of documentation errors such as those fixed by this pull-request. Such a tool would have immense value if the false positives can be kept to zero so that it only reports actual documentation errors that need correction. But even if your tool has a small number of false positives it could still be useful.

Yes, I thought about it and tried submitting to golangci-lint. But the problem is that there are too many false positives. The first word of a method can be anything (and all are legal, such as return, The, This, etc.), and it does not necessarily have to be the method name. .

So most of the time it still takes a lot of time to filter.

xiaq commented 2 months ago

Thanks!

@goodfirm do you mind sharing the check you've worked on? Godoc comments for exported functions in the Elvish codebase are always supposed to start with the symbol being documented, so having a check specifically against that would still be useful.