diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..d26694b --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,2 @@ +# Use Dockerfile to get dependabot version bumps after new image is released +FROM ghcr.io/eclipse-score/devcontainer:v1.2.0 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..23f4e44 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "name": "eclipse-s-core", + "build": { + "dockerfile": "Dockerfile" + } +} diff --git a/.github/ISSUE_TEMPLATE/bug_fix.md b/.github/ISSUE_TEMPLATE/bug_fix.md index 43ba081..c9c4f35 100644 --- a/.github/ISSUE_TEMPLATE/bug_fix.md +++ b/.github/ISSUE_TEMPLATE/bug_fix.md @@ -9,5 +9,3 @@ assignees: '' > [!IMPORTANT] > Make sure to link this issue with the PR for your bugfix. - - diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..aa645e7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,74 @@ +# ******************************************************************************* +# 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 +# ******************************************************************************* +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + groups: + all-in-one: + patterns: + - "*" + update-types: + - "minor" + - "patch" + + - package-ecosystem: cargo + directory: / + schedule: + interval: daily + groups: + all-in-one: + patterns: + - "*" + update-types: + - "minor" + - "patch" + + - package-ecosystem: pip + directory: / + schedule: + interval: daily + groups: + all-in-one: + patterns: + - "*" + update-types: + - "minor" + - "patch" + + - package-ecosystem: docker + directories: + - /.devcontainer + schedule: + interval: daily + groups: + all-in-one: + patterns: + - "*" + update-types: + - "minor" + - "patch" + + - package-ecosystem: bazel + directory: / + schedule: + interval: daily + groups: + all-in-one: + patterns: + - "*" + update-types: + - "minor" + - "patch" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..a0e92b7 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,27 @@ +# ******************************************************************************* +# 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 +# ******************************************************************************* +name: pre-commit +on: + pull_request: + types: [opened, reopened, synchronize] +jobs: + self_test: + name: 🔬 Self Test + runs-on: ubuntu-latest + steps: + - name: 📥 Check out + uses: actions/checkout@v6 + - name: ⚙️ Setup uv + uses: astral-sh/setup-uv@v5 + - name: 🛠️ Run pre-commit + run: uvx pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4337a22 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,34 @@ +# ******************************************************************************* +# 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 +# ******************************************************************************* +exclude: '.patch$' +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + - id: check-added-large-files + 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: 31ff8eee214e4e97ef8f5cb46e443273515b63ec + hooks: + - id: copyright + + - repo: https://github.com/google/yamlfmt + rev: 21ca5323a9c87ee37a434e0ca908efc0a89daa07 # v0.21.0 + hooks: + - id: yamlfmt diff --git a/.vscode/restructuredtext.code-snippets b/.vscode/restructuredtext.code-snippets index bde982f..1e66353 100644 --- a/.vscode/restructuredtext.code-snippets +++ b/.vscode/restructuredtext.code-snippets @@ -344,4 +344,4 @@ " ${7}" ] } -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 47cb954..af7dc5f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,12 +5,10 @@ "files.trimTrailingWhitespace": true, "editor.insertSpaces": true, "editor.tabCompletion": "on", - // Default for any filetype "editor.rulers": [ 99 ], - // Exclude build, temp and cache folders "files.watcherExclude": { ".*/**": true, @@ -19,7 +17,6 @@ ".venv*/**": true, "_build/**": true, }, - // Python Settings // Exclude build, temp and cache folders "python.analysis.exclude": [ @@ -42,22 +39,20 @@ }, "editor.defaultFormatter": "charliermarsh.ruff", }, - // Markdown Settings "[markdown]": { // We mostly write markdown in some combination with python, // so we use the same rulers as python. "editor.rulers": [ - 79, 99 + 79, + 99 ] }, - "bazel.lsp.command": "bazel", "bazel.lsp.args": [ "run", "//:starpls_server" ], - // RST Settings "[restructuredtext]": { "editor.tabSize": 3, @@ -99,8 +94,8 @@ "--ignore-glob=bazel-*/*", "--ignore-glob=.venv_docs/*", "--ignore-glob=_build/*", - ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, + "python.analysis.typeCheckingMode": "off", } diff --git a/examples/BUILD b/examples/BUILD index 012dd54..4bc4ed5 100644 --- a/examples/BUILD +++ b/examples/BUILD @@ -1,3 +1,15 @@ +# ******************************************************************************* +# 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 +# ******************************************************************************* # Needed for Dash tool to check python dependency licenses. filegroup( name = "cargo_lock", diff --git a/project_config.bzl b/project_config.bzl index f764a1d..df83e7c 100644 --- a/project_config.bzl +++ b/project_config.bzl @@ -1,3 +1,15 @@ +# ******************************************************************************* +# 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 +# ******************************************************************************* # project_config.bzl PROJECT_CONFIG = { "asil_level": "QM", diff --git a/tests/rust/test_main.rs b/tests/rust/test_main.rs index 9390d5e..7194058 100644 --- a/tests/rust/test_main.rs +++ b/tests/rust/test_main.rs @@ -1,3 +1,15 @@ +// ******************************************************************************* +// 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 +// +// +// SPDX-License-Identifier: Apache-2.0 +// ******************************************************************************* #[test] fn test_hello() { assert_eq!(2 + 2, 4);