Skip to content

funlen: ignore-comments setting is reversed #5593

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

Closed
6 of 7 tasks
koki-sato opened this issue Mar 24, 2025 · 1 comment · Fixed by #5594
Closed
6 of 7 tasks

funlen: ignore-comments setting is reversed #5593

koki-sato opened this issue Mar 24, 2025 · 1 comment · Fixed by #5594
Assignees
Labels
bug Something isn't working

Comments

@koki-sato
Copy link

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

How did you install golangci-lint?

Brew

Description of the problem

funlen's ignore-comments setting is the opposite of what is intended.

cfg.ignoreComments = !settings.IgnoreComments

https://golangci-lint.run/usage/linters/#funlen

linters-settings:
  funlen:
    ...
    # Ignore comments when counting lines.
    # Default false
    ignore-comments: true

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.64.8 built with go1.24.1 from 8b37f14 on 2025-03-17T16:54:02Z

Configuration

linters:
  disable-all: true
  enable:
    - funlen

linters-settings:
  funlen:
    lines: 2
    ignore-comments: true

Go environment

$ go version
go version go1.24.1 darwin/arm64

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run
main.go:3:6: Function 'main' is too long (4 > 2) (funlen)
func main() {
     ^

A minimal reproducible example or link to a public repository

package main

func main() {
	// Comment 1
	// Comment 2
	// Comment 3
	print("Hello, world!")
}

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@koki-sato koki-sato added the bug Something isn't working label Mar 24, 2025
Copy link

boring-cyborg bot commented Mar 24, 2025

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez self-assigned this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants