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

Add the destination in the gomoddirectives text #7

Open
ldemailly opened this issue Aug 10, 2024 · 4 comments
Open

Add the destination in the gomoddirectives text #7

ldemailly opened this issue Aug 10, 2024 · 4 comments
Labels

Comments

@ldemailly
Copy link

ldemailly commented Aug 10, 2024

Right now the error printed is

go.mod:11:1: replacement are not allowed: golang.org/x/term (gomoddirectives)
replace golang.org/x/term => github.com/ldemailly/term v0.0.0-20240809182630-68dd89eaaf9e
^

for

replace golang.org/x/term => github.com/ldemailly/term v0.0.0-20240809182630-68dd89eaaf9e

it would be a lot more useful if it was

go.mod:11:1: replacement are not allowed: golang.org/x/term => github.com/ldemailly/term (gomoddirectives)

so exclude rule could be written based on trusting the destination of the replace and not the source

originally golangci/golangci-lint#4896

@ldez
Copy link
Owner

ldez commented Aug 10, 2024

Your use case is related to a specific context, I'm not sure about the balance between the value and the maintenance of this kind of option.

I can understand why you want that but it's also the result of shared configuration (that I considered a bad practice, it's my opinion) and a one-off action (that you can allow temporarily).

I don't see in which other context this option is useful but I can miss something, so I will wait for other user feedback.

@ldez ldez added the proposal label Aug 10, 2024
@ldemailly
Copy link
Author

ldemailly commented Aug 10, 2024

how is the error message having only half of the information a specific context issue? what is the harm if the message had the other half like I'm suggesting?

in other words, what is

issues:
  exclude-rules:
    - linters:
        - gomoddirectives
      text: "replacement are not allowed: ...

for in golangci-lint's config for if not to use the information in the messages provided by the linters?
(ps yes this is not the golangci-lint's repo but that's where it's used)

@ldez
Copy link
Owner

ldez commented Aug 10, 2024

It's the same thing for the message.

For me, an option is the best approach to handle that instead of relying on something that is not inside the linter.

The "destination" is useless in the large majority of the cases.

@ldez
Copy link
Owner

ldez commented Aug 10, 2024

(ps yes this is not the golangci-lint's repo but that's where it's used)

You must stop with your subtext immediately.

I can understand frustration, and we can disagree and discuss, but what you're doing isn't a discussion.

I tried to understand your problem, I spent time on it, I tried to provide an answer that fits your need and my vision of the solution, so please change your approach.

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

No branches or pull requests

2 participants