You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/01/07 08:36:41 UTC

[camel-k] branch main updated: fix(doc): filter nolint comments in documentation trait

This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new 51115ca  fix(doc): filter nolint comments in documentation trait
51115ca is described below

commit 51115ca9f8d0ee1e0e586c4e09e7805aaf9203d2
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Jan 5 16:20:30 2022 +0100

    fix(doc): filter nolint comments in documentation trait
    
    Closes #2760
---
 cmd/util/doc-gen/generators/traitdocgen.go | 4 +++-
 docs/modules/traits/pages/container.adoc   | 1 -
 docs/modules/traits/pages/jolokia.adoc     | 1 -
 docs/modules/traits/pages/route.adoc       | 1 -
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/cmd/util/doc-gen/generators/traitdocgen.go b/cmd/util/doc-gen/generators/traitdocgen.go
index e915986..9c1f084 100644
--- a/cmd/util/doc-gen/generators/traitdocgen.go
+++ b/cmd/util/doc-gen/generators/traitdocgen.go
@@ -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!"
@@ -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)
 		}
 	}
diff --git a/docs/modules/traits/pages/container.adoc b/docs/modules/traits/pages/container.adoc
index 1934134..f5be96f 100755
--- a/docs/modules/traits/pages/container.adoc
+++ b/docs/modules/traits/pages/container.adoc
@@ -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**.
 
diff --git a/docs/modules/traits/pages/jolokia.adoc b/docs/modules/traits/pages/jolokia.adoc
index 0671161..0f0499f 100755
--- a/docs/modules/traits/pages/jolokia.adoc
+++ b/docs/modules/traits/pages/jolokia.adoc
@@ -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**.
 
diff --git a/docs/modules/traits/pages/route.adoc b/docs/modules/traits/pages/route.adoc
index 42b3874..493586c 100755
--- a/docs/modules/traits/pages/route.adoc
+++ b/docs/modules/traits/pages/route.adoc
@@ -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**.