File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,22 +35,26 @@ repos:
3535 language : system
3636 pass_filenames : false
3737 files : ' (^|/)(MODULE\.bazel|.*\.bzl|BUILD(\.bazel)?)$'
38-
39- - repo : https://github.com/rhysd/actionlint
40- rev : v1.7.11
41- hooks :
4238 - id : actionlint
43- args :
44- # Disable shellcheck and pyflakes for now, to enforce consistent behavior.
45- - -shellcheck=
46- - -pyflakes=
47-
48- - repo : https://github.com/astral-sh/ruff-pre-commit
49- rev : v0.15.9
50- hooks :
39+ name : actionlint
40+ # Disable shellcheck and pyflakes for now, to enforce consistent behavior.
41+ entry : tools/run_tool.sh actionlint -shellcheck= -pyflakes=
42+ language : system
43+ require_serial : true
44+ types : [yaml]
45+ files : ^\.github/workflows/
5146 - id : ruff-check
52- args : [ --fix ]
47+ name : ruff-check
48+ entry : tools/run_tool.sh ruff check --fix
49+ language : system
50+ require_serial : true
51+ types : [python]
5352 - id : ruff-format
53+ name : ruff-format
54+ entry : tools/run_tool.sh ruff format
55+ language : system
56+ require_serial : true
57+ types : [python]
5458
5559 # Note: this is super slow, therefore it is last
5660 - repo : local
Original file line number Diff line number Diff line change 2626 ],
2727 source_dir = "docs" ,
2828)
29+
30+ # bazel run //:shellcheck
31+ alias (
32+ name = "shellcheck" ,
33+ actual = "@score_devcontainer//tools:shellcheck" ,
34+ )
35+
36+ # bazel run //:actionlint
37+ alias (
38+ name = "actionlint" ,
39+ actual = "@score_devcontainer//tools:actionlint" ,
40+ )
Original file line number Diff line number Diff line change @@ -70,3 +70,6 @@ http_file(
7070)
7171
7272bazel_dep (name = "score_process" , version = "1.5.4" )
73+
74+ # Provide the tools from the devcontainer to Bazel
75+ bazel_dep (name = "score_devcontainer" , version = "1.5.0" )
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # *******************************************************************************
4+ # Copyright (c) 2026 Contributors to the Eclipse Foundation
5+ #
6+ # See the NOTICE file(s) distributed with this work for additional
7+ # information regarding copyright ownership.
8+ #
9+ # This program and the accompanying materials are made available under the
10+ # terms of the Apache License Version 2.0 which is available at
11+ # https://www.apache.org/licenses/LICENSE-2.0
12+ #
13+ # SPDX-License-Identifier: Apache-2.0
14+ # *******************************************************************************
15+
16+ # Unified entry point for running a CLI tool by name.
17+ # Inside a container the tool is expected on PATH; outside, it is resolved via Bazel.
18+ # See https://github.com/eclipse-score/devcontainer/tree/main/tools for further information.
19+
20+ set -euo pipefail
21+
22+ if [[ " $# " -lt 1 ]]; then
23+ echo " Usage: $0 <tool> [args...]" >&2
24+ exit 2
25+ fi
26+
27+ tool_name=" $1 "
28+ shift
29+
30+ if { [[ -f /.dockerenv ]] || [[ -f /run/.containerenv ]] || [[ -d /devcontainer ]]; } &&
31+ command -v " ${tool_name} " > /dev/null 2>&1 ; then
32+ exec " ${tool_name} " " $@ "
33+ elif command -v bazel > /dev/null 2>&1 ; then
34+ exec bazel run " @score_devcontainer//tools:${tool_name} " -- " $@ "
35+ else
36+ echo " Could not run '${tool_name} ': not available on PATH in a container, and bazel was not found." >&2
37+ exit 127
38+ fi
You can’t perform that action at this time.
0 commit comments