Skip to content

Commit

Permalink
Added Missing license headers and license headers to generation of tr…
Browse files Browse the repository at this point in the history
…aits.yaml

Signed-off-by: Andrea Cosentino <[email protected]>
  • Loading branch information
oscerd authored and squakez committed Oct 4, 2023
1 parent 301bacd commit 2423260
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
name: Bug Report
description: Create a report to help us improve
labels: ["kind/bug"]
Expand Down
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
name: Feature Request
description: Suggest an idea for this project
labels: ["kind/feature"]
Expand Down
18 changes: 18 additions & 0 deletions cmd/util/doc-gen/generators/traitmetadatagen.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ import (

const traitFile = "traits.yaml"

const licenseHeader = "# ---------------------------------------------------------------------------\n" +
"# Licensed to the Apache Software Foundation (ASF) under one or more\n" +
"# contributor license agreements. See the NOTICE file distributed with\n" +
"# this work for additional information regarding copyright ownership.\n" +
"# The ASF licenses this file to You under the Apache License, Version 2.0\n" +
"# (the \"License\"); you may not use this file except in compliance with\n" +
"# the License. You may obtain a copy of the License at\n" +
"#\n" +
"# http://www.apache.org/licenses/LICENSE-2.0\n" +
"#\n" +
"# Unless required by applicable law or agreed to in writing, software\n" +
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
"# See the License for the specific language governing permissions and\n" +
"# limitations under the License.\n" +
"# ---------------------------------------------------------------------------\n"

// traitMetaDataGen produces YAML documentation about trait descriptions.
type traitMetaDataGen struct {
generator.DefaultGen
Expand Down Expand Up @@ -113,6 +130,7 @@ func (g *traitMetaDataGen) Finalize(c *generator.Context, w io.Writer) error {
return err
}

fmt.Fprintf(file, "%s", string(licenseHeader))
data, err := yaml.Marshal(g.Root)
if err != nil {
fmt.Fprintf(file, "error: %v", err)
Expand Down

0 comments on commit 2423260

Please sign in to comment.