Skip to content

Commit 315b411

Browse files
Enable cr_checker copyright check via pre-commit hook (#265)
* ci: enable cr_checker copyright check via pre-commit hook * fix: add copyright headers to files missing SPDX block * fix: add missing copyright header to overall_status.rst * fix: remove broken copyright_checker Bazel target * fix: add missing blank line after copyright block in overall_status.rst
1 parent 793b7cd commit 315b411

24 files changed

Lines changed: 316 additions & 190 deletions

File tree

.devcontainer/prepare_workspace.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
#!/bin/bash
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-License-Identifier: Apache-2.0
13+
# *******************************************************************************
214
set -euo pipefail
315

416
# Install pipx

.github/workflows/copyright.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
name: Copyright check
14+
on:
15+
pull_request:
16+
types: [opened, reopened, synchronize]
17+
merge_group:
18+
types: [checks_requested]
19+
jobs:
20+
copyright-check:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
- name: Set up Python 3
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: '3.12'
29+
# Runs the `copyright` hook from .pre-commit-config.yaml (cr_checker from
30+
# eclipse-score/tooling). The hook reports any file missing a copyright
31+
# header and fails the job, gating PRs without touching Bazel.
32+
- name: Run cr_checker via pre-commit
33+
uses: pre-commit/action@v3.0.1
34+
with:
35+
extra_args: copyright --all-files

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
# Runs cr_checker (copyright header check) directly from the eclipse-score/tooling
14+
# repo as a pre-commit hook, instead of via the Bazel `//:copyright` target.
15+
#
16+
# Rationale (see https://github.com/eclipse-score/reference_integration/issues/166):
17+
# the Bazel target pulls in the docs() -> needs_json -> @score_process graph, which
18+
# fails to resolve because score_process/score_platform are dev_dependencies in the
19+
# score modules and are therefore invisible when reference_integration aggregates
20+
# them. The pre-commit hook runs the checker as a standalone script over the repo's
21+
# files, so it is unaffected by Bazel module resolution.
22+
repos:
23+
- repo: https://github.com/eclipse-score/tooling
24+
rev: 31ff8eee214e4e97ef8f5cb46e443273515b63ec
25+
hooks:
26+
- id: copyright

.vscode/rustfmt.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
#!/usr/bin/env bash
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-License-Identifier: Apache-2.0
13+
# *******************************************************************************
214

315
bazel run @score_tooling//format_checker:rustfmt_with_policies

BUILD

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# *******************************************************************************
1313

1414
load("@score_docs_as_code//:docs.bzl", "docs")
15-
load("@score_tooling//:defs.bzl", "copyright_checker", "setup_starpls", "use_format_targets")
15+
load("@score_tooling//:defs.bzl", "setup_starpls", "use_format_targets")
1616

1717
# Docs-as-code
1818
docs(
@@ -41,27 +41,6 @@ setup_starpls(
4141
visibility = ["//visibility:public"],
4242
)
4343

44-
# Copyright check
45-
copyright_checker(
46-
name = "copyright",
47-
srcs = [
48-
".github",
49-
"bazel_common",
50-
"docs",
51-
"feature_integration_tests",
52-
"images",
53-
"runners",
54-
"rust_coverage",
55-
"scripts",
56-
"showcases",
57-
"//:BUILD",
58-
"//:MODULE.bazel",
59-
],
60-
config = "@score_tooling//cr_checker/resources:config",
61-
template = "@score_tooling//cr_checker/resources:templates",
62-
visibility = ["//visibility:public"],
63-
)
64-
6544
# Add target for formatting checks
6645
use_format_targets()
6746

bazel_common/score_images.MODULE.bazel

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +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-License-Identifier: Apache-2.0
12+
# *******************************************************************************
113
bazel_dep(name = "rules_oci", version = "2.3.1")
214
git_override(
315
module_name = "rules_oci",

docs/s_core_v_1/roadmap/overall_status.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
115
:hide-toc:
216

317
Overall Status

feature_integration_tests/test_scenarios/cpp/src/internals/persistency/kvs_build_helpers.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +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-License-Identifier: Apache-2.0
12-
// *******************************************************************************
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-License-Identifier: Apache-2.0
12+
********************************************************************************/
1313

1414
#ifndef INTERNALS_PERSISTENCY_KVS_BUILD_HELPERS_H_
1515
#define INTERNALS_PERSISTENCY_KVS_BUILD_HELPERS_H_

feature_integration_tests/test_scenarios/cpp/src/internals/persistency/kvs_instance.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +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-License-Identifier: Apache-2.0
12-
// *******************************************************************************
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-License-Identifier: Apache-2.0
12+
********************************************************************************/
1313

1414
#include "kvs_instance.h"
1515

feature_integration_tests/test_scenarios/cpp/src/internals/persistency/kvs_instance.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +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-License-Identifier: Apache-2.0
12-
// *******************************************************************************
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-License-Identifier: Apache-2.0
12+
********************************************************************************/
1313

1414
#ifndef INTERNALS_PERSISTENCY_KVS_INSTANCE_H_
1515
#define INTERNALS_PERSISTENCY_KVS_INSTANCE_H_

0 commit comments

Comments
 (0)