-
Notifications
You must be signed in to change notification settings - Fork 10
Feat: Add pre-commit, on-pr workflow & cr_checker #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
001c165
0cd94bf
9a5a91c
0177e58
5aacc85
f2a798e
dc77c23
3d82bd4
6b191ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,5 +22,3 @@ assignees: '' | |
|
|
||
| > [!IMPORTANT] | ||
| > Make sure to link this issue with the PR for your bugfix. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # ******************************************************************************* | ||
| # 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 | ||
| # ******************************************************************************* | ||
|
|
||
| self-hosted-runner: | ||
| labels: [] | ||
|
|
||
| paths: | ||
| .github/workflows/**/*.{yml,yaml}: | ||
| ignore: | ||
| - 'file "/bin/sh" does not exist.*entrypoint' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ inputs: | |
| required: false | ||
| runs: | ||
| using: "docker" | ||
| image: "jorisroovers/gitlint:0.19.1" | ||
| image: "docker://jorisroovers/gitlint:0.19.1" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed otherwise it can not infer that the entrypoint should be from the docker and |
||
| entrypoint: /bin/sh | ||
| args: | ||
| - -c | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # ******************************************************************************* | ||
| # 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: PR Checks | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| merge_group: | ||
| types: [checks_requested] | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
|
|
||
| jobs: | ||
| # Common S-CORE Workflow | ||
|
|
||
| common: | ||
| uses: eclipse-score/cicd-workflows/.github/workflows/on-pr.yml@88cb460c47cb49efeb25cd7b73c8945dd1c5bce2 # on-pr/v0.0.0 | ||
| permissions: | ||
| contents: read | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This workflow will start all needed things in the repo, detecting what is inside the repo and then starting it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Things like pre-commit for example, that then start other things. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,5 +51,6 @@ styles/ | |
|
|
||
| # Python | ||
| .venv | ||
| .venv_docs | ||
| __pycache__/ | ||
| /.coverage | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| # ******************************************************************************* | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-yaml | ||
| args: ["-m"] | ||
| - id: check-toml | ||
| - id: check-json | ||
| exclude: ^\.vscode/ # those are actually jsonc files | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: check-merge-conflict | ||
| - id: check-case-conflict | ||
| - id: mixed-line-ending | ||
| - id: detect-private-key | ||
| - id: check-added-large-files | ||
| args: ["--maxkb=150"] | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: bazel-mod-tidy | ||
| name: format Bazel module files | ||
| entry: bazel mod tidy | ||
| language: system | ||
| pass_filenames: false | ||
| files: '(^|/)(MODULE\.bazel|.*\.bzl|BUILD(\.bazel)?)$' | ||
|
|
||
| - id: bzlmod-lockfile | ||
| name: bazel mod deps lockfile check | ||
| entry: bazel mod deps --lockfile_mode=error | ||
| language: system | ||
| pass_filenames: false | ||
| files: '(^|/)MODULE\.bazel(\.lock)?$' | ||
|
|
||
| - id: actionlint | ||
| name: actionlint | ||
| # Disable shellcheck and pyflakes for now, to enforce consistent behavior. | ||
| entry: tools/run_tool.sh actionlint -shellcheck= -pyflakes= | ||
| language: system | ||
| require_serial: true | ||
| types: [yaml] | ||
| files: ^\.github/workflows/ | ||
| - id: ruff-check | ||
| name: ruff-check | ||
| entry: tools/run_tool.sh ruff check --fix | ||
| language: system | ||
| require_serial: true | ||
| types: [python] | ||
| - id: ruff-format | ||
| name: ruff-format | ||
| entry: tools/run_tool.sh ruff format | ||
| language: system | ||
| require_serial: true | ||
| types: [python] | ||
|
|
||
|
|
||
| # Ensure every file has a copyright header as per the Eclipse Foundation's requirements | ||
| # Runs `cr_checker` | ||
| - repo: https://github.com/eclipse-score/tools | ||
| rev: 7694bf823421b5542cd2f45239b8bdf205dbface | ||
| hooks: | ||
| - id: copyright |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -344,4 +344,4 @@ | |
| " ${7}" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
|
|
||
| load("@score_docs_as_code//:docs.bzl", "docs") | ||
| load("@score_tooling//:defs.bzl", "copyright_checker", "dash_license_checker", "setup_starpls", "use_format_targets") | ||
| load("@score_tools//cr_checker:cr_checker.bzl", "copyright_checker") | ||
| load("//:project_config.bzl", "PROJECT_CONFIG") | ||
|
|
||
| setup_starpls( | ||
|
|
@@ -29,17 +30,6 @@ docs( | |
|
|
||
| copyright_checker( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This repo now has
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think for this PR from my side, yes. |
||
| name = "copyright", | ||
| srcs = [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, we donb't need to specify now explicetly the repo structure or folders to check? the fuill repo will be taken by default?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything that this command |
||
| ".github", | ||
| "docs", | ||
| "examples", | ||
| "score", | ||
| "tools", | ||
| "//:BUILD", | ||
| "//:MODULE.bazel", | ||
| ], | ||
| config = "@score_tooling//cr_checker/resources:config", | ||
| template = "@score_tooling//cr_checker/resources:templates", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the only way I could fix the warning.
It did not accept any other solution, this seems to be accepted workaround (adding the specific thing to the ignore list)