Skip to content
Merged
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
22 changes: 9 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,18 @@ repos:
- id: check-added-large-files
args: [--maxkb=100, --enforce-all] # increase or add git lfs if too strict
exclude: org.eclipse.dash.licenses-1.1.0.jar|blanket_index.html
- repo: https://github.com/google/yamlfmt
rev: 21ca5323a9c87ee37a434e0ca908efc0a89daa07 # v0.21.0
hooks:
- id: yamlfmt
- repo: https://codeberg.org/fsfe/reuse-tool
rev: a1bb792acda6fd0724936b4ebbdbc8eceb9c0459 # v6.2.0
hooks:
- id: reuse-lint-file
exclude: \.(svg|tpl|txt|conf|lock|json|in|png)$
- repo: local
hooks:
- id: copyright
name: Check and fix copyright headers with cr_checker
entry: cr_checker/tool/pre-commit_wrapper --extensions h hpp c cpp rs rst py sh bzl ini yml yaml trlc rsl puml svg BUILD bazel --fix
# this would be the better language implementation, but struggle with python tooling
# language: python
language: script
entry: bazel run //:copyright-fix -- --modified-only
language: system
pass_filenames: false
minimum_pre_commit_version: 3.2.0
types_or: [python, yaml, ini, rst, sh, shell, bash, bazel, c, c++, rust, plantuml, svg]
- id: format
name: Check formatting with bazel format.check
entry: bazel test //:format.check
language: system
pass_filenames: false
minimum_pre_commit_version: 3.2.0
27 changes: 5 additions & 22 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,12 @@ exports_files([

copyright_checker(
name = "copyright",
# Whole-repo scope via a git exclude-magic pathspec: every file tracked
# by git is checked except .github/skills (those SKILL.md / README.md
# files are distributed verbatim to downstream repos via //:sync_skills
# and are not subject to this repo's copyright checker).
srcs = [
#"//tools", # Use full label if src is a package
"//:BUILD",
"//:MODULE.bazel",
"cli_helper",
"cr_checker",
"dash",
"third_party/format",
"python_basics",
"starpls",
"tools",
"lobster_bazel",
"bazel",
"manual_analysis",
"plantuml",
"validation",
"third_party/lint",
"skills_sync",

# Add other directories/files you want to check
# Note: .github/skills is intentionally excluded; those SKILL.md /
# README.md files are distributed verbatim to downstream repos via
# //:sync_skills and are not subject to this repo's copyright checker.
":(exclude).github/skills/**",
],
config = "//cr_checker/resources:config",
exclusion = "//cr_checker/resources:exclusion",
Expand Down
19 changes: 19 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,25 @@ use_repo(pip, "pip_lobster_bazel")

use_repo(pip, "pip_rules_score")

# cr_checker's own Python deps (e.g. rapidfuzz), kept separate from the
# shared pip_tooling hub (pytest/basedpyright/pylint) since cr_checker is a
# standalone, independently reusable component.
[
pip.parse(
envsubst = ["PIP_INDEX_URL"],
extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"],
hub_name = "pip_cr_checker",
python_version = "3.{}".format(version),
requirements_lock = "//cr_checker:requirements_3_{}.txt".format(version),
)
for version in [
"11",
"12",
]
]

use_repo(pip, "pip_cr_checker")

###############################################################################
# Multitool Hub (for ruff, pyright, actionlint, etc.)
###############################################################################
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<!--
Copyright (c) 2026 Contributors to the Eclipse Foundation
<!-- ----------------------------------------------------------------------------
Copyright (c) 2026 Contributors to the Eclipse Foundation

SPDX-License-Identifier: Apache-2.0
-->
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
----------------------------------------------------------------------------- -->

# Score Tooling

Expand Down Expand Up @@ -82,7 +89,7 @@ Here are two examples to showcase how to do this.

```
load("@score_python_basics//:defs.bzl", "score_py_pytest") => load("@score_tooling//:defs.bzl", "score_py_pytest")
load("@score_cr_checker//:cr_checker.bzl", "copyright_checker") => load("@score_tooling//:defs.bzl", "copyright_checker")
load("@score_cr_checker//:cr_checker.bzl", "copyright_checker") => load("@score_tooling//cr_checker:cr_checker.bzl", "copyright_checker")
```

All things inside of 'tooling' can now be imported from `@score_tooling//:defs.bzl`.
Expand All @@ -91,14 +98,14 @@ The available import targets are:
- score_virtualenv
- score_py_pytest
- dash_license_checker
- copyright_checker
- cli_helper
- setup_starpls
- rust_coverage_report

Formatting and linting are no longer re-exported from `defs.bzl`; use
Formatting, linting, and cr_checker are no longer re-exported from `defs.bzl`; use
`@score_tooling//third_party/format:macros.bzl`, `@score_tooling//third_party/lint:macros.bzl`,
or the `@score_tooling//third_party/format:rustfmt_with_policies` label directly.
`@score_tooling//cr_checker:cr_checker.bzl`, or the `@score_tooling//third_party/format:rustfmt_with_policies`
label directly.

## Format the tooling repository

Expand Down
22 changes: 12 additions & 10 deletions bazel/rules/rules_score/docs/tool_qualification.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
..
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
# *******************************************************************************
# 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
# *******************************************************************************

Tool Qualification
==================
Expand Down
12 changes: 6 additions & 6 deletions bazel/rules/rules_score/examples/seooc/docs/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"assumptions_of_use",
"glossary",
)

# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
Expand All @@ -16,6 +10,12 @@ load(
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"assumptions_of_use",
"glossary",
)
load("@trlc//:trlc.bzl", "trlc_requirements_test")

assumptions_of_use(
Expand Down
15 changes: 11 additions & 4 deletions coverage/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<!--
Copyright (c) 2026 Contributors to the Eclipse Foundation
<!-- ----------------------------------------------------------------------------
Copyright (c) 2026 Contributors to the Eclipse Foundation

SPDX-License-Identifier: Apache-2.0
-->
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
----------------------------------------------------------------------------- -->

# Coverage

Expand Down
6 changes: 3 additions & 3 deletions cpp/libclang/integration_test/test_framework.rs
Original file line number Diff line number Diff line change
@@ -1,15 +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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

use std::{path::PathBuf, str::FromStr};

Expand Down
7 changes: 4 additions & 3 deletions cpp/libclang/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
///////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************
// 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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

use clap::Parser as ClapParser;
use env_logger::Builder;
use log::{debug, error, LevelFilter};
Expand Down
7 changes: 4 additions & 3 deletions cpp/libclang/src/utils/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
///////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************
// 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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

mod render;
mod write;

Expand Down
7 changes: 4 additions & 3 deletions cpp/libclang/src/utils/render.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
///////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************
// 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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

use clang::{Entity, EntityKind, EntityVisitResult};

pub fn render_entity_tree(entity: &Entity, level: usize) -> String {
Expand Down
7 changes: 4 additions & 3 deletions cpp/libclang/src/utils/write.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
///////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************
// 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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

use log::{debug, error};
use serde::Serialize;
use std::fs;
Expand Down
7 changes: 4 additions & 3 deletions cpp/libclang/src/visitor/src/class_parser_helper.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
///////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************
// 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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

#![cfg_attr(test, allow(dead_code))]

use clang::{Entity, EntityKind, Type, TypeKind};
Expand Down
6 changes: 3 additions & 3 deletions cpp/libclang/src/visitor/src/class_parser_helper_test.rs
Original file line number Diff line number Diff line change
@@ -1,15 +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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

#[path = "class_parser_helper.rs"]
mod class_parser_helper;
Expand Down
7 changes: 4 additions & 3 deletions cpp/libclang/src/visitor/src/class_visitor.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
///////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************
// 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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

use clang::{Entity, EntityKind};
use std::collections::HashSet;

Expand Down
6 changes: 3 additions & 3 deletions cpp/libclang/src/visitor/src/class_visitor_test.rs
Original file line number Diff line number Diff line change
@@ -1,15 +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
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
////////////////////////////////////////////////////////////////////////////////////
// *******************************************************************************

use class_diagram::{RelationType, SimpleEntity, SourceLocation};
use visit_tu::context::{
Expand Down
Loading
Loading