Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: exclude Swagger Codegen files #4967

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

@ldez ldez added enhancement New feature or improvement area: processors labels Aug 30, 2024
@ldez ldez force-pushed the feat/ignore-swagger-codegen branch from a193410 to cc0eeba Compare August 30, 2024 00:39
Copy link
Member

@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this configurable so the user can set their own pattern?

@ldez ldez added the blocked: until next minor Will be a part of the next minor release of golangci-lint label Aug 30, 2024
@ldez
Copy link
Member Author

ldez commented Aug 30, 2024

I don't think we need a configuration: the exclude options are enough in the majority of the cases.
The AutogeneratedExclude processor is specialized for the generated files that are known patterns, and it's already weird to have the "lax" mode.

This PR is a type of "workaround" before Swagger changes its pattern to follow the standard because Swagger should change its pattern.

@bombsimon
Copy link
Member

This PR is a type of "workaround" before Swagger changes its pattern to follow the standard because Swagger should change its pattern.

Why is Swagger different from any other code that diverges from the standard such that we should add workarounds? I agree lax mode is a bit weird, if the user could configure their own patterns we could get rid of it and only support the official pattern. Anyone using code that doesn't follow that (like Swagger) could add their own patterns.

@ldez
Copy link
Member Author

ldez commented Aug 30, 2024

Why is Swagger different from any other code that diverges from the standard such that we should add workarounds?

It's not so different but Swagger/OpenAPI is, I think, the most popular format for API documentation.
So it is worth handling that, but to be honest, I think, at some point, we may remove the "lax" mode.

People should follow the Go standard comment pattern for generated code, it's the standard.

@ldez ldez removed the blocked: until next minor Will be a part of the next minor release of golangci-lint label Sep 4, 2024
@ldez ldez added this to the next milestone Sep 4, 2024
@ldez ldez merged commit a6bd868 into golangci:master Sep 4, 2024
16 checks passed
@ldez ldez deleted the feat/ignore-swagger-codegen branch September 4, 2024 15:01
@ldez ldez modified the milestones: next, v1.61 Sep 9, 2024
uudashr pushed a commit to uudashr/golangci-lint that referenced this pull request Sep 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area: processors enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autogenerated files from swagger-codegen not ignored
3 participants