Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"moby": "false" // does not work with Debian Trixie based images
},
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
"version": "4.2.0"
"version": "4.5.1"
}
},
"postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/post_create_command.sh",
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # v5.0.0
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand Down
5 changes: 5 additions & 0 deletions src/s-core-devcontainer/.devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"resolved": "ghcr.io/devcontainers-community/features/llvm@sha256:4f464ab97a59439286a55490b55ba9851616f6f76ac3025e134127ac08ad79e2",
"integrity": "sha256:4f464ab97a59439286a55490b55ba9851616f6f76ac3025e134127ac08ad79e2"
},
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
"version": "2.0.18",
"resolved": "ghcr.io/devcontainers-extra/features/pre-commit@sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e",
"integrity": "sha256:6e0bb2ce80caca1d94f44dab5d0653d88a1c00984e590adb7c6bce012d0ade6e"
},
"ghcr.io/devcontainers/features/common-utils": {
"version": "2.5.4",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:00fd45550f578d9d515044d9e2226e908dbc3d7aa6fcb9dee4d8bdb60be114cf",
Expand Down
1 change: 0 additions & 1 deletion src/s-core-devcontainer/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"./s-core-local"
],
"remoteUser": "vscode",

"customizations": {
"vscode": {
"extensions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
"id": "s-core-local",
"version": "1.0.0",
"description": "Tools which are not available as already existing development container feature",
"dependsOn": {
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
"version": "4.5.1"
}
},
"onCreateCommand": "/devcontainer/features/s-core-local/on_create_command.sh",
"postCreateCommand": {
// The repos in S-CORE may use different Bazel versions. This ensures that the required version is installed.
// Should be removed once we provide versions of the devcontainer.
"Install matching Bazel version": "bash /devcontainer/features/s-core-local/install_matching_bazel_version.sh",
"Setup persistent bash history": "bash /devcontainer/features/s-core-local/setup_command_history.sh"
"Setup persistent bash history": "bash /devcontainer/features/s-core-local/setup_command_history.sh",
"Enable pre-commit hooks": "bash /devcontainer/features/s-core-local/enable_pre_commit_hooks.sh"
},
"mounts": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

PRE_COMMIT_CONFIG_FILE=".pre-commit-config.yaml"

if [[ -f "${PRE_COMMIT_CONFIG_FILE}" ]]
then
echo "Pre-commit configuration found (${PRE_COMMIT_CONFIG_FILE})"
$PIPX_BIN_DIR/pre-commit install
else
echo "No pre-commit configuration found (${PRE_COMMIT_CONFIG_FILE})"
echo "Skipping pre-commit hook's installation"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -euo pipefail
# Read tool versions + metadata into environment variables
. /devcontainer/features/s-core-local/versions.sh

# pre-commit, it is available via $PATH in login shells, but not in non-login shells
check "validate pre-commit is working and has the correct version" bash -c "$PIPX_BIN_DIR/pre-commit --version | grep '4.5.1'"

# Common tooling
# For an unknown reason, dot -V reports on Ubuntu Noble a version 2.43.0, while the package has a different version.
# Hence, we have to work around that.
Expand Down