diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b2222ec0..fa0aec4d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -12,4 +12,4 @@ # ******************************************************************************* # Use Dockerfile to get dependabot version bumps after new image is released -FROM ghcr.io/eclipse-score/devcontainer:v1.10.0 +FROM ghcr.io/eclipse-score/devcontainer:v1.11.0 diff --git a/.devcontainer/run-tool b/.devcontainer/run-tool new file mode 100755 index 00000000..7821981d --- /dev/null +++ b/.devcontainer/run-tool @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +# Unified entry point for running a CLI tool by name. +# Inside a container the tool is expected on PATH; outside, it is resolved via Bazel. +# See https://github.com/eclipse-score/devcontainer/tree/main/tools for further information. +# +# Do not modify this file. Its source of truth is managed by the +# SCORE devcontainer standardization policy. + +set -euo pipefail + +if [[ "$#" -lt 1 ]]; then + echo "Usage: $0 [args...]" >&2 + exit 2 +fi + +tool_name="$1" +shift + +if { [[ -f /.dockerenv ]] || [[ -f /run/.containerenv ]] || [[ -d /devcontainer ]]; } && + command -v "${tool_name}" >/dev/null 2>&1; then + exec "${tool_name}" "$@" +elif command -v bazel >/dev/null 2>&1; then + exec bazel run "@score_devcontainer//tools:${tool_name}" -- "$@" +else + echo "Could not run '${tool_name}': not available on PATH in a container, and bazel was not found." >&2 + exit 127 +fi diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index f574847d..6d9de1da 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -29,6 +29,6 @@ jobs: - name: 📥 Check out uses: actions/checkout@v7 - name: 🛠️ Install pre-commit - run: pip install pre-commit rapidfuzz + run: pip install pre-commit - name: ✅ Run pre-commit run: pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcd64b68..9e0384f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,11 +23,10 @@ repos: args: [--maxkb=50, --enforce-all] # increase or add git lfs if too strict exclude: MODULE.bazel.lock - - repo: https://github.com/eclipse-score/tooling - rev: 991cc658a4627251118f8241b00ffb1a3b1f0ab7 + - repo: https://github.com/eclipse-score/tools + rev: 7694bf823421b5542cd2f45239b8bdf205dbface hooks: - id: copyright - args: [--exclusion-file, /dev/null] - repo: https://codeberg.org/fsfe/reuse-tool rev: a1bb792acda6fd0724936b4ebbdbc8eceb9c0459 # v6.2.0 diff --git a/MODULE.bazel b/MODULE.bazel index 52371229..263d8de6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -85,6 +85,9 @@ single_version_override( version = "1.70.0", ) +# Provide the tools from the devcontainer to Bazel +bazel_dep(name = "score_devcontainer", version = "1.11.0", dev_dependency = True) + ############################################################################### # # S-CORE Toolchains (DO NOT MODIFY) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 636bbf63..ce5e331d 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -777,7 +777,8 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cr_checker/0.3.1/MODULE.bazel": "f49e037d7fbc0b2a8b2734fc6b47334e8cc8589ca7a5aa0f3ccca85cc5f79fac", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_dash_license_checker/0.1.1/MODULE.bazel": "76681dbd2d45b5c540869a2337174086c56c54953aab1d02cd878b59d31d13a5", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.10.0/MODULE.bazel": "2a37c7b8107a6dd51f0fe673bf11a6d200bc3c078bc7104bc96eb9d2f6772f66", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.10.0/source.json": "3b0e923664da034c9db5564a5fccd31837bcd165cf72ecfb7ae5ff64a00d0883", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.11.0/MODULE.bazel": "fb6041c96e949a151307b4690ee81cf5d9254d6bf79540184b16567b04397171", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.11.0/source.json": "b379a2499cf06f16de65c2981665c3723afba9e858ed16b453f044882067f56f", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.7.0/MODULE.bazel": "f9a5971fbd05f0ed14e7a373dbf58af72a5c58d081537a75c314daaf61c92ae9", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_devcontainer/1.9.0/MODULE.bazel": "2a04a354eb7a77d478bb43ba20b1dac0758af858172a760e4290621bef1a2f28", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_docs_as_code/0.2.4/MODULE.bazel": "ea4801e96c87e2b8650a0fa9e5fed9b8bdbef05c1bc3e30003ba527d5af60a43",