Skip to content

Commit 74c2964

Browse files
authored
Perform SPDX license and copyright checks with reuse (#81)
reuse is specialized to check for SPDX license and copyright information in source files. It is capable of checking way more file types than we currently check with opengrep and faster. In addition to that the Eclipse foundation recommends to use it. `reuse annotate` is run in pre-commit hooks, which automatically fixes missing / incorrect headers.
1 parent 23ff984 commit 74c2964

46 files changed

Lines changed: 337 additions & 122 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*******************************************************************************
2+
Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
4+
See the NOTICE file(s) distributed with this work for additional
5+
information regarding copyright ownership.
6+
7+
This program and the accompanying materials are made available under the
8+
terms of the Apache License Version 2.0 which is available at
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
12+
SPDX-License-Identifier: Apache-2.0
13+
*******************************************************************************
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*******************************************************************************
2+
Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
4+
See the NOTICE file(s) distributed with this work for additional
5+
information regarding copyright ownership.
6+
7+
This program and the accompanying materials are made available under the
8+
terms of the Apache License Version 2.0 which is available at
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
12+
SPDX-License-Identifier: Apache-2.0
13+
*******************************************************************************

.devcontainer/post_create_command.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# terms of the Apache License Version 2.0 which is available at
1111
# https://www.apache.org/licenses/LICENSE-2.0
1212
#
13+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
1314
# SPDX-License-Identifier: Apache-2.0
1415
# *******************************************************************************
1516

@@ -19,5 +20,3 @@ pre-commit install
1920
scripts/create_builder.sh
2021

2122
sudo apt-get update && sudo apt-get install -y shellcheck
22-
23-
scripts/install_opengrep.sh

.github/CODEOWNERS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
115
* @opajonk @lurtz

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
# *******************************************************************************
43
# Copyright (c) 2026 Contributors to the Eclipse Foundation
54
#
@@ -10,6 +9,7 @@
109
# terms of the Apache License Version 2.0 which is available at
1110
# https://www.apache.org/licenses/LICENSE-2.0
1211
#
12+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
1313
# SPDX-License-Identifier: Apache-2.0
1414
# *******************************************************************************
1515

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
# *******************************************************************************
43
# Copyright (c) 2026 Contributors to the Eclipse Foundation
54
#
@@ -10,6 +9,7 @@
109
# terms of the Apache License Version 2.0 which is available at
1110
# https://www.apache.org/licenses/LICENSE-2.0
1211
#
12+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
1313
# SPDX-License-Identifier: Apache-2.0
1414
# *******************************************************************************
1515

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
115
# Exported image files shall never be committed.
216
/export.img
317
build/

.pre-commit-config.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
---
2+
# *******************************************************************************
3+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
4+
#
5+
# See the NOTICE file(s) distributed with this work for additional
6+
# information regarding copyright ownership.
7+
#
8+
# This program and the accompanying materials are made available under the
9+
# terms of the Apache License Version 2.0 which is available at
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
13+
# SPDX-License-Identifier: Apache-2.0
14+
# *******************************************************************************
15+
216
repos:
317
- repo: https://github.com/pre-commit/pre-commit-hooks
418
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
@@ -23,8 +37,8 @@ repos:
2337

2438
- repo: local
2539
hooks:
26-
- id: opengrep
27-
name: Check Mandatory OpenGrep Rules
28-
entry: ./opengrep/run_opengrep.sh
40+
- id: reuse annotate
41+
name: Check and fix copyright headers with reuse annotate
42+
entry: ./scripts/run_reuse_annotate.sh
2943
language: system
3044
pass_filenames: false

.reuse/templates/apache-2.0.jinja2

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{#
2+
*******************************************************************************
3+
Copyright (c) 2026 Contributors to the Eclipse Foundation
4+
5+
See the NOTICE file(s) distributed with this work for additional
6+
information regarding copyright ownership.
7+
8+
This program and the accompanying materials are made available under the
9+
terms of the Apache License Version 2.0 which is available at
10+
https://www.apache.org/licenses/LICENSE-2.0
11+
12+
SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
13+
SPDX-License-Identifier: Apache-2.0
14+
*******************************************************************************
15+
#}
16+
17+
*******************************************************************************
18+
Copyright (c) 2026 Contributors to the Eclipse Foundation
19+
20+
See the NOTICE file(s) distributed with this work for additional
21+
information regarding copyright ownership.
22+
23+
This program and the accompanying materials are made available under the
24+
terms of the Apache License Version 2.0 which is available at
25+
https://www.apache.org/licenses/LICENSE-2.0
26+
27+
{% for copyright_line in copyright_lines %}
28+
{{ copyright_line }}
29+
{% endfor %}
30+
{% for expression in spdx_expressions %}
31+
SPDX-License-Identifier: {{ expression }}
32+
{% endfor %}
33+
*******************************************************************************

.shellcheckrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-FileCopyrightText: 2026 Contributors to the Eclipse Foundation
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
115
external-sources=true
216

317
# Enable all checks as long as it works

0 commit comments

Comments
 (0)