Skip to content
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

missing config allow-leading-space for nolintlint #3063

Closed
4 tasks done
vincentscdc opened this issue Aug 5, 2022 · 4 comments
Closed
4 tasks done

missing config allow-leading-space for nolintlint #3063

vincentscdc opened this issue Aug 5, 2022 · 4 comments
Labels
question Further information is requested

Comments

@vincentscdc
Copy link

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

the setting allow-leading-space for nolintlint is not part of the NoLintLint settings

Version of golangci-lint

$ golangci-lint --version
# 1.48.0

Configuration file

$ cat .golangci.yml
[linters-settings.nolintlint]
require-explanation = true
require-specific = true
allow-leading-space = true

Go environment

$ go version && go env
# go1.19

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# unneeded

Code example or link to a public repository

// add your code here
@vincentscdc vincentscdc added the bug Something isn't working label Aug 5, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 5, 2022

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

@nhatthm
Copy link

nhatthm commented Aug 5, 2022

Same here.

I use this configuration

linters-settings:
  nolintlint:
    # Disable to ensure that nolint directives don't have a leading space.
    # Default: true
    allow-leading-space: false

however golangci-lint still reports issues with // nolint...

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Aug 5, 2022
@ldez
Copy link
Member

ldez commented Aug 5, 2022

Hello,

Due to a change of go fmt inside go1.19.
We have to enforce the directive style.

So the option allow-leading-space has been dropped.

The syntax of directives is: [a-zA-Z]+:[a-zA-Z\-0-9]+.
The spaces around : and after the // must be removed.

If you do that your IDE (ex: goland) will format the directive as a directive and it will not add extra space.

Related to:
#3002
#1658 (comment)

@tstraley
Copy link

tstraley commented Aug 5, 2022

@ldez can you please update the documentation if this setting has been removed? https://golangci-lint.run/usage/linters/#nolintlint

@ldez ldez mentioned this issue Sep 9, 2022
4 tasks
MrJoy added a commit to SixtyAI/cli-o-mat that referenced this issue Jan 30, 2023
marckhouzam added a commit to marckhouzam/tanzu-plugin-runtime that referenced this issue Apr 18, 2023
Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
marckhouzam added a commit to marckhouzam/tanzu-plugin-runtime that referenced this issue Apr 18, 2023
Some of the updated linters require go 1.19 so this commit updates the
github workflow to use go 1.19 for the "check" section.

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
marckhouzam added a commit to vmware-tanzu/tanzu-plugin-runtime that referenced this issue Apr 18, 2023
Some of the updated linters require go 1.19 so this commit updates the
github workflow to use go 1.19 for the "check" section.

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
marckhouzam added a commit to marckhouzam/tanzu-cli that referenced this issue Apr 30, 2023
Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
marckhouzam added a commit to marckhouzam/tanzu-cli that referenced this issue Apr 30, 2023
Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
marckhouzam added a commit to marckhouzam/tanzu-cli that referenced this issue Apr 30, 2023
Fixes vmware-tanzu#240

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
marckhouzam added a commit to marckhouzam/tanzu-cli that referenced this issue May 1, 2023
Fixes vmware-tanzu#240

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
vuil pushed a commit to vmware-tanzu/tanzu-plugin-runtime that referenced this issue May 2, 2023
Some of the updated linters require go 1.19 so this commit updates the
github workflow to use go 1.19 for the "check" section.

Note that "allow-leading-space" is no longer supported as mentioned in
golangci/golangci-lint#3063 (comment)

Fix new warnings that are now reported.

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
dduportal added a commit to dduportal/jenkins-version that referenced this issue Dec 5, 2023
dduportal added a commit to dduportal/jenkins-version that referenced this issue Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants