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

fix(doc): filter nolint comments in documentation trait #2851

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/util/doc-gen/generators/traitdocgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (

const (
tagTrait = "+camel-k:trait"
tagLint = "nolint"

adocCommonMarkerStart = "// Start of autogenerated code - DO NOT EDIT!"
adocCommonMarkerEnd = "// End of autogenerated code - DO NOT EDIT!"
Expand Down Expand Up @@ -234,7 +235,8 @@ func filterOutTagsAndComments(comments []string) []string {
res := make([]string, 0, len(comments))
for _, l := range comments {
if !strings.HasPrefix(strings.TrimLeft(l, " \t"), "+") &&
!strings.HasPrefix(strings.TrimLeft(l, " \t"), "TODO:") {
!strings.HasPrefix(strings.TrimLeft(l, " \t"), "TODO:") &&
!strings.HasPrefix(strings.TrimLeft(l, " \t"), tagLint) {
res = append(res, l)
}
}
Expand Down
1 change: 0 additions & 1 deletion docs/modules/traits/pages/container.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ The Container trait can be used to configure properties of the container where t

It also provides configuration for Services associated to the container.

nolint: tagliatelle

This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.

Expand Down
1 change: 0 additions & 1 deletion docs/modules/traits/pages/jolokia.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ The Jolokia trait activates and configures the Jolokia Java agent.

See https://jolokia.org/reference/html/agents.html

nolint: tagliatelle

This trait is available in the following profiles: **Kubernetes, Knative, OpenShift**.

Expand Down
1 change: 0 additions & 1 deletion docs/modules/traits/pages/route.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The recommended approach to set the key and certificates is to use `secrets` to
following parameters to reference them: `tls-certificate-secret`, `tls-key-secret`, `tls-ca-certificate-secret`, `tls-destination-ca-certificate-secret`
See the examples section at the end of this page to see the setup options.

nolint: tagliatelle

This trait is available in the following profiles: **OpenShift**.

Expand Down