Closed g4s8 closed 1 week ago
Hey, thank you for opening your first Pull Request !
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
go/analysis
.v1.0.0
, v0.1.0
.init()
.panic()
.log.Fatal()
, os.Exit()
, or similar..golangci.next.reference.yml
.golangci.next.reference.yml
must be updated..golangci.reference.yml
must NOT be edited.enable
and disable
options.golangci.yml
of golangci-lint itself must not be edited and the linter must not be added to this file.lintersdb/builder_linter.go
and .golangci.next.reference.yml
.WithLoadMode(...)
):
goanalysis.LoadModeSyntax
-> no WithLoadForGoAnalysis()
in lintersdb/builder_linter.go
goanalysis.LoadModeTypesInfo
, it requires WithLoadForGoAnalysis()
in lintersdb/builder_linter.go
WithSince(...)
must be the next minor version (v1.X.0
) of golangci-lint.WithURL()
must contain the URL of the repository.jsonschema/golangci.next.jsonschema.json
should be updated.jsonschema/golangci.jsonschema.json
must NOT be edited..gitignore
(IDE files, binaries, OS files, etc. should not be committed)main
as the default branch name.The golangci-lint team will edit this comment to check the boxes before and during the review.
The code review will start after the completion of those checkboxes (except for the specific items that the team will help to verify).
The reviews should be addressed as commits (no squash).
If the author of the PR is a member of the golangci-lint team, he should not edit this message.
This checklist does not imply that we will accept the linter.
Hello,
The checklist is not completed but I already have some problems with this linter:
env
struct tag name but the option allows changing the name.env
struct tag should have more documentation than others?Everything feels extremely niche and related to the promotion of your tool: envdoc
to generate the comments on env
struct tag.
I will sleep on that but, for now, I think this linter will not be accepted.
Hello @ldez, I see your point. The goal of both tools envdoc
and the linter is to solve the problem of undocumented env vars, because I've seen this problem many times in my experience. The linter does no directly promote original tool, rather both tools "promotes" writing documentation for env vars.
I will understand if you decide that this linter is niche and close PR. If not, please let me know what should be fixed.
@g4s8 maybe it's better to create a doctag
linter that will warn about any undocumented tags? This linter will be in a separate repository and not inside envdoc
.
@alexandear thanks, sounds like a good idea
Sorry, but a linter about "undocumented" tags will have the same problem: why fields with struct tags should be more documented than other fields? This will lead to a large amount of false positives.
Based on my previous comment, for now, I closed this PR.
I recommend modifying your linter to be usable as a plugin: https://golangci-lint.run/contributing/new-linters/#how-to-add-a-private-linter-to-golangci-lint
Add new docenv linter to validate that struct fields with env tags are documented: https://github.com/g4s8/envdoc/blob/master/docenv/README.md
Linter source code: https://github.com/g4s8/envdoc/tree/master/linter