Skip to content

Idea: support "nolint ranges" #129

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

Open
alecthomas opened this issue Jun 25, 2018 · 9 comments
Open

Idea: support "nolint ranges" #129

alecthomas opened this issue Jun 25, 2018 · 9 comments
Assignees
Labels
area: nolint Related to nolint directive and nolintlint enhancement New feature or improvement no decision No decision to fix or not

Comments

@alecthomas
Copy link
Contributor

Revive has the concept of begin/end blocks for nolinting. See here.

This could be useful under some circumstances.

@jirfag jirfag added the enhancement New feature or improvement label Jun 26, 2018
@AlekSi
Copy link
Contributor

AlekSi commented Jul 25, 2018

I would like to see this implemented. My use-case: disable gocyclo for a specific exported method without exposing nolint:gocyclo in the godoc.

@tpounds tpounds added the stale No recent correspondence or work activity label Oct 1, 2019
@stale stale bot closed this as completed Oct 16, 2019
@AlekSi
Copy link
Contributor

AlekSi commented Oct 16, 2019

Stale bot went rampant. @jirfag please reopen.

@jirfag jirfag reopened this Oct 16, 2019
@stale stale bot removed the stale No recent correspondence or work activity label Oct 16, 2019
@stale
Copy link

stale bot commented Apr 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Apr 13, 2020
@AlekSi
Copy link
Contributor

AlekSi commented Apr 13, 2020

My use-case: disable gocyclo for a specific exported method without exposing nolint:gocyclo in the godoc.

That's still a problem.

@stale stale bot removed the stale No recent correspondence or work activity label Apr 13, 2020
@theckman
Copy link
Contributor

@AlekSi is there a reason you're not able to do:

// Save provides a complex save method!
func Save() { // nolint:gocyclo

@AlekSi
Copy link
Contributor

AlekSi commented May 18, 2020

A better exemple coud be:

// Save provides a complex save method using third-party library with really long method names.
func Save() {
  ...
  very long line of code //nolint:lll
  ...
  another very long line of code //nolint:lll
  ...
  one more //nolint:lll
  ...
}

@theckman
Copy link
Contributor

@AlekSi I appreciate that other use cases exist, I was asking if my suggestion works for your specific challenge above.

@jirfag jirfag added the good first issue Good for newcomers label May 18, 2020
@sanposhiho
Copy link
Member

sanposhiho commented May 3, 2021

I have just had the experience of ignore lll reports like @AlekSi mentioned, and I've been wanting this feature too.
Can I be the assignee for this Issue?

I'm thinking of doing ignore as follows.

func Save() {
  //nolint-begin:lll
  very long line of code 
  another very long line of code
  one more 
  ...
  //nolint-end:lll
}

Please give your opinions on this idea. (And other opinions are also verrry welcome.)

@stale
Copy link

stale bot commented Jul 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Jul 10, 2022
@ldez ldez removed the stale No recent correspondence or work activity label Jul 10, 2022
@ldez ldez added no decision No decision to fix or not area: nolint Related to nolint directive and nolintlint and removed good first issue Good for newcomers labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: nolint Related to nolint directive and nolintlint enhancement New feature or improvement no decision No decision to fix or not
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants