vaguecoder / gorilla-mux

A fork of gorilla/mux, the powerful HTTP router and URL matcher for building Go web servers with 🦍
http://www.gorillatoolkit.org/pkg/mux
BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

Chore: Add .golangci.yaml file #34

Closed tanryberdi closed 1 year ago

tanryberdi commented 1 year ago

See #4

tanryberdi commented 1 year ago

@vaguecoder could you please review? 🙏 I disabled many linters, for examples (lll - length of line), we did not decide length of line, wdyt?

vaguecoder commented 1 year ago

@tanryberdi A few things to update here. I'll update on respective files shortly.

vaguecoder commented 1 year ago

The comments from .golangci.yml are overloaded, even for an open-source project. Please remove all comments including the licensing part above.

The only things, as per me, require comments here are:

  1. issues section. Not the default values and all, but if you have excluded some linter for a specific reason.
  2. linters-settings section. Not the default values and all, but if you have linter configured.

I just did some trial and error and found the following are the minimum settings we require as of now for the above 2 sections:

linters-settings:
  cyclop:
    max-complexity: 30
  nolintlint:
    allow-unused: true

issues:
  exclude-rules:
    - path: "_test\\.go"
      linters:
        - bodyclose
        - noctx

I'm turning my back on my original request. Let's stick to this minimal settings and we can have future issues to add or configure more linters.

Please keep the linters that you've enabled so far and remove the comments describing them.

vaguecoder commented 1 year ago

Also, I ask one more request of you on the same. Please add TODO against

  1. cyclop - to reduce the complexity
  2. nolintlint - to fix this (I believe you added inline comments wherever nolint is specified)
  3. bodyclose - to close the body
  4. noctx - to check if we can really use context in these places

We'll address these in future issues.