Allow to ignoring "unhandled errors" by their type and method
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.6k
- Forks
- 330
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
When one is using the method "WriteString" of the type "strings::Builder" and does not handle the error it is flagged because all errors must be handled. However, This method never returns an error. Hence, it makes sense to ignore it (even by default).
The problem with revive is, that it does not allow to ignore methods with their type, since one can only ignore them with their variable name. So instead of "strings.Builder.WriteString" (or another annoation) to ignore it, i need to write "b.WriteString" (in our code this is one instance) which however, would include implementations that do return an error.
Describe the solution you'd like
Allow to define "strings.Builder.WriteString" (or "strings::Builder.WriteString") to allow to ignore the method "WriteString" of the type "Builder" in the package "strings".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating the unhandled-errors rule and its ignore configuration, then trace how ignored method names are matched today. Done means a qualified form such as strings.Builder.WriteString can target only that type and method, with tests covering the requested syntax and existing variable-name behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100