Skip to content

revive: cut output from exported rule #1993

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
gucio321 opened this issue May 17, 2021 · 5 comments · Fixed by #1994
Closed

revive: cut output from exported rule #1993

gucio321 opened this issue May 17, 2021 · 5 comments · Fixed by #1994
Labels
enhancement New feature or improvement

Comments

@gucio321
Copy link

Is your feature request related to a problem? Please describe.
Hi there, sometimes, output from revive linter is really long, like

exported: exported var DataVar should have comment or be unexported (revive)
var DataVar map[int]string {
1: "s1",
2:"s2",
3:"s3",

e.t.c.

2000:"s2000",
}

in my opinion it is a bit hard to read. is it possible to cut it?

Describe the solution you'd like
e.g., linter should print up to x lines of cod.

@gucio321 gucio321 added the enhancement New feature or improvement label May 17, 2021
@ldez
Copy link
Member

ldez commented May 17, 2021

Hello,

could you provide a reproducible example?

Edit: I'm able to reproduce.

@ldez ldez added feedback required Requires additional feedback dependencies Relates to an upstream dependency question Further information is requested and removed dependencies Relates to an upstream dependency enhancement New feature or improvement labels May 17, 2021
@ldez
Copy link
Member

ldez commented May 17, 2021

Do you have other examples?

I don't think that cut the source code output is a good idea, but if it's only produced by the exported rule I have a solution.

@gucio321
Copy link
Author

Hi @ldez !
thanks for really fast answer!
Yes, I think, that it is produced by exported only.

@ldez ldez added enhancement New feature or improvement and removed question Further information is requested labels May 17, 2021
@ldez ldez changed the title proposal: cut output from revive revive: cut output from exported rule May 17, 2021
@ldez ldez removed the feedback required Requires additional feedback label May 17, 2021
@gucio321
Copy link
Author

example (code)
package somepackage

var DataVar = map[int]string{
        1:  "s1",
        2:  "s1",
        3:  "s1",
        4:  "s1",
        5:  "s1",
        6:  "s1",
        7:  "s1",
        8:  "s1",
        9:  "s1",
        10: "s1",
        11: "s1",
        12: "s1",
        13: "s1",
        14: "s1",
        15: "s1",
        16: "s1",
        17: "s1",
        18: "s1",
        19: "s1",
        20: "s1",
        21: "s1",
        22: "s1",
        23: "s1",
        24: "s1",
        25: "s1",
        26: "s1",
        27: "s1",
        28: "s1",
        29: "s1",
        30: "s1",
        31: "s1",
        32: "s1",
        33: "s1",
        34: "s1",
        35: "s1",
        36: "s1",
        37: "s1",
        38: "s1",
        39: "s1",
}
example (.golangci.yaml)
linters:
  disable-all: true
  enable:
    - revive

@ldez
Copy link
Member

ldez commented May 17, 2021

@gucio321 #1994 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants