go-telegram / bot

Telegram Bot API Go framework
MIT License
494 stars 45 forks source link

[proposal] Adding linters to the pipelines #87

Open archimed-shaman opened 3 weeks ago

archimed-shaman commented 3 weeks ago

Hi everyone,

Just wanted to say that this library has proven to be really useful. Considering its popularity, I think adding linters to the Go pipelines would be beneficial. It would help maintain code quality and catch potential issues early.

If you agree, I could create a pull request with the linters and necessary fixes. We can also discuss the specific rules to include.

negasus commented 3 weeks ago

Great idea. Feel free to do PR. I would be glad to see a list of linters in your opinion

archimed-shaman commented 2 weeks ago

Great idea. Feel free to do PR. I would be glad to see a list of linters in your opinion

Ok, I will locally check a set of linters that would be appropriate for this project and will get back to you with a proposal soon!

far4599 commented 2 weeks ago

I have had some negative experiences adding liters to a big corporate project. What I learned is that it's better to do it step by step, adding one linter per PR. And it's better to agree on what kind of linters to be enabled and why so you do not waste time implementing the ones that bring no value.

renatosaksanni commented 1 week ago

Hi everyone,

Just wanted to say that this library has proven to be really useful. Considering its popularity, I think adding linters to the Go pipelines would be beneficial. It would help maintain code quality and catch potential issues early.

If you agree, I could create a pull request with the linters and necessary fixes. We can also discuss the specific rules to include.

Hi, that's great. I have a suggestion about some effective linters to use at the beginning, as listed below:

- govet 
    -> It's a standard linter and helps catch common mistakes
- errcheck
    -> Ensures that the errors are properly handled, which is critical for the Go code
- staticcheck
    -> Detects many subtle issues in code, such as unused code, deprecated functions, and other code smells
- unused
    -> Helps keep the codebase clean by identifying and removing dead code
- gofmt
    -> Ensures consistency in code formatting, making the code easier to read and maintain
- goimports
    -> Keeps import statements tidy and ensures that unused imports are removed
- gocritic
    -> Provides additional checks that can improve code quality and performance.

cheers!