Skip to content

Commit

Permalink
Add SPDX license identifier comment to most source files (#157)
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Fingerhut <[email protected]>
Signed-off-by: Andy Fingerhut <[email protected]>
  • Loading branch information
jafingerhut authored Feb 7, 2025
1 parent d1d8c5c commit 1cbd1b5
Show file tree
Hide file tree
Showing 48 changed files with 66 additions and 4 deletions.
20 changes: 17 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ send us an email ([email protected]).

## Apache CLA

All developers must sign the [P4.org](http://p4.org) CLA and return it to
([email protected]) before making contributions. The CLA is available
[here](https://p4.org/assets/P4_Language_Consortium_Membership_Agreement.pdf).
Developers must use DCO ([Developer Certificate of
Origin](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin))
to sign every commit that they wish to merge into this repository.
See [this
announcement](https://lists.p4.org/g/p4-announce/topic/github_contributor_license/107784276)
for more details.

## SPDX License Identifier

To enable the use of some automated tools for tracking software
licenses, both in this project and in any future projects that might
copy source files from it, all source files must have a comment
containing an SPDX License Identifier.

TODO: Add a link to a central p4lang repository document about this,
when one is created. Probably that will be
https://github.com/p4lang/p4c/blob/main/docs/licenses.md

## Coding guidelines

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,10 @@ copyright header:
See the License for the specific language governing permissions and
limitations under the License.

SPDX-License-Identifier: Apache-2.0

This can be done automatically using
[addlicense](https://github.com/google/addlicense) as follows:
```sh
addlicense -c "The P4-Constraints Authors" -l apache ./p4_constraints
addlicense -c "The P4-Constraints Authors" -s -l apache ./p4_constraints
```
1 change: 1 addition & 0 deletions gutils/collections.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2023 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/ordered_map.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/overload.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/parse_text_proto.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 The MediaPipe Authors.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/protocol_buffer_matchers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/*
* Copyright 2018 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/protocol_buffer_matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/*
* Copyright 2018 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/ret_check.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 The MediaPipe Authors.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/ret_check.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 The MediaPipe Authors.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/source_location.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/status_builder.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/status_builder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/status_macros.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2019 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/status_matchers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copied and adapted from https://github.com/google/iree.

// Copyright 2019 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/testing.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2023 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gutils/testing.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2023 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/ast.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/ast.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/ast.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/ast_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/constraint_info.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/constraint_info.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/interpreter.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/interpreter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/interpreter_golden_test_runner.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/interpreter_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/symbolic_interpreter.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2023 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/symbolic_interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/*
* Copyright 2023 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/type_checker.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/type_checker.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/backend/type_checker_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/cli/p4check.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/constraint_source.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/ast_constructors.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/ast_constructors.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/constraint_kind.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2023 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/lexer.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/lexer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/lexer_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/parser.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/parser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/parser_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/token.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/token.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/frontend/token_test.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/quote.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2020 The P4-Constraints Authors
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions p4_constraints/quote.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2020 The P4-Constraints Authors
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 1cbd1b5

Please sign in to comment.