Skip to content

Commit

Permalink
fix: update copyright
Browse files Browse the repository at this point in the history
- Updates the copyrights for Broadcom.
- Updates `main.go` to add the copyright after the SDK is generated.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam committed Oct 3, 2024
1 parent ed2eff1 commit 249cc77
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 22 deletions.
5 changes: 3 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [email protected].
All complaints will be reviewed and investigated promptly and fairly.
reported to the community leaders responsible for enforcement at
[email protected]. All complaints will be reviewed and investigated
promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand Down
19 changes: 5 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
# Contributing to vcf-sdk-go
# Contributing

Before you start working with vcf-sdk-go please read our Developer Certificate
of Origin. All contributions to this repository must be signed as described on
that page. Your signature certifies that you wrote the patch or have the right
to pass it on as an open-source patch
Before you start working with `vmware/vcf-sdk-go` please read our Developer
Certificate of Origin. All contributions to this repository must be signed as
described on that page. Your signature certifies that you wrote the patch or have
the right to pass it on as an open-source patch

For any questions about the DCO process, please refer to our [FAQ](https://cla.vmware.com/dco).

## Getting Started

The SDK is generated using [go-swagger](https://github.com/go-swagger/go-swagger).
Any changes should come from the official swagger files for VMware Cloud
Foundation and then processed using `make swagger`.

This will run the correct swagger commands and any fixups needed. After
the generation, the flow below can be used for submitting a change.

## Contribution Flow

This is a general outline of what a contributor's workflow looks like:
Expand Down
5 changes: 3 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Copyright 2023 VMware, Inc.
© Broadcom. All Rights Reserved.
The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

This product is licensed to you under the BSD 2 clause (the "License"). You may not use this product except in compliance with the License.

This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ incredibly useful:

## License

Copyright 2023 VMware, Inc.
© Broadcom. All Rights Reserved.
The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -82,5 +83,4 @@ POSSIBILITY OF SUCH DAMAGE.
[contributing]: CONTRIBUTING.md
[issues]: https://github.com/vmware/vcf-sdk-go/issues
[golang-install]: https://golang.org/doc/install
[go-swagger]: https://github.com/go-swagger/go-swagger
[vmware-cla-dco]: https://cla.vmware.com/dco
6 changes: 4 additions & 2 deletions copyright.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
Copyright 2023 VMware, Inc.
SPDX-License-Identifier: BSD-2-Clause
// © Broadcom. All Rights Reserved.
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-2-Clause
//
40 changes: 40 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
// © Broadcom. All Rights Reserved.
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
// SPDX-License-Identifier: BSD-2-Clause

//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config cfg.yaml swagger.json
//go:generate go run main.go -add-header

package main

import (
"flag"
"fmt"
"os"
)

func main() {
addHeader := flag.Bool("add-header", false, "Add header to generated SDK.")
flag.Parse()

if *addHeader {
const headerFile = "copyright.txt"
const generatedFile = "./vcf/vcf.gen.go"

header, err := os.ReadFile(headerFile)
if err != nil {
fmt.Println(fmt.Errorf("error reading header file: %w", err))
os.Exit(1)
}

content, err := os.ReadFile(generatedFile)
if err != nil {
fmt.Println(fmt.Errorf("error reading generated file: %w", err))
os.Exit(1)
}

newContent := string(header) + string(content)

err = os.WriteFile(generatedFile, []byte(newContent), 0644)
if err != nil {
fmt.Println(fmt.Errorf("error writing to generated file: %w", err))
os.Exit(1)
}

fmt.Println("Header added to", generatedFile)
}
}
4 changes: 4 additions & 0 deletions vcf/vcf.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 249cc77

Please sign in to comment.