Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build --java_language_version=17
build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17
build --@score-baselibs//score/json:base_library=nlohmann
build --@score-baselibs//score/mw/log/flags:KRemote_Logging=False

test --test_output=errors

common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build

# allow empty globs for docs
build --noincompatible_disallow_empty_glob
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.3.0
97 changes: 97 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]

line-length = 120
indent-width = 4

[lint]
select = [
# flake8-boolean-trap
"FBT",
# flake8-bugbear
"B",
# flake8-builtins
"A",
# flake8-comprehensions
"C4",
# flake8-fixme
"FIX",
# flake8-implicit-str-concat
"ISC",
# flake8-pie
"PIE",
# flake8-print
"T20",
# flake8-pytest-style
"PT",
# flake8-raise
"RSE",
# flake8-return
"RET501",
"RET502",
"RET503",
"RET504",
# flake8-self
"SLF",
# flake8-simplify
"SIM",
# flake8-type-checking
"TC",
# flake8-unused-arguments
"ARG",
# flake8-use-pathlib
"PTH",

# isort
"I",

# pycodestyle error
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
]
ignore = ["F401", "PTH123", "ARG002"]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
3 changes: 3 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
formatter:
type: basic
retain_line_breaks: true
59 changes: 59 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# *******************************************************************************
# Copyright (c) 2025 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
# *******************************************************************************
load("@score_cr_checker//:cr_checker.bzl", "copyright_checker")
load("@score_dash_license_checker//:dash.bzl", "dash_license_checker")
load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_format_checker//:macros.bzl", "use_format_targets")
load("@score_starpls_lsp//:starpls.bzl", "setup_starpls")
load("//:project_config.bzl", "PROJECT_CONFIG")

# Creates all documentation targets:
# - `docs:incremental` for building docs incrementally at runtime
# - `docs:live_preview` for live preview in the browser without an IDE

# - `docs:docs` for building documentation at build-time
docs(
data = [
"@score_platform//:needs_json",
"@score_process//:needs_json",
],
source_dir = "docs",
)

setup_starpls(
name = "starpls_server",
visibility = ["//visibility:public"],
)

copyright_checker(
name = "copyright",
srcs = [
"src",
"tests",
"//:BUILD",
"//:MODULE.bazel",
],
config = "@score_cr_checker//resources:config",
template = "@score_cr_checker//resources:templates",
visibility = ["//visibility:public"],
)

dash_license_checker(
src = "//examples:cargo_lock",
file_type = "", # let it auto-detect based on project_config
project_config = PROJECT_CONFIG,
visibility = ["//visibility:public"],
)

# Add target for formatting checks
use_format_targets()
31 changes: 26 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
[package]
name = "fault-lib"
version = "0.1.0"
[workspace]
resolver = "2"

members = [
"src/common",
"src/dfm_lib",
"src/fault_lib",
"src/xtask",
]

[workspace.package]
version = "0.0.1"
edition = "2024"
license-file = "LICENSE.md"
authors = ["S-CORE Contributors"]
readme = "README.md"

[dependencies]
thiserror = "2"
[workspace.dependencies]
env_logger = "0.11.8"
iceoryx2 = { git = "https://github.com/eclipse-iceoryx/iceoryx2.git", rev = "eba5da4b8d8cb03bccf1394d88a05e31f58838dc"}
iceoryx2-bb-container = { git = "https://github.com/eclipse-iceoryx/iceoryx2.git", rev = "eba5da4b8d8cb03bccf1394d88a05e31f58838dc"}
log = "0.4.22"
mockall = "0.13.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = "0.10"
thiserror = "2.0.17"
xtask = { path = "src/xtask" }
113 changes: 113 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# *******************************************************************************
# Copyright (c) 2025 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
# *******************************************************************************
module(
name = "score_fault_lib",
version = "0.1.0",
compatibility_level = 0,
)

bazel_dep(name = "rules_python", version = "1.4.1")

PYTHON_VERSION = "3.12"

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = PYTHON_VERSION,
)
use_repo(python)

# Add GoogleTest dependency
bazel_dep(name = "googletest", version = "1.17.0")
bazel_dep(name = "google_benchmark", version = "1.9.4")

# Rust rules for Bazel
bazel_dep(name = "rules_rust", version = "0.67.0")

# Checker rule for CopyRight checks/fixs
bazel_dep(name = "score_cr_checker", version = "0.3.1")

# C/C++ rules for Bazel
bazel_dep(name = "rules_cc", version = "0.2.13")

# LLVM Toolchains Rules - host configuration
bazel_dep(name = "score_starpls_lsp", version = "0.1.0")

# Dash license checker
bazel_dep(name = "score_dash_license_checker", version = "0.1.2")

# Format checker
bazel_dep(name = "score_format_checker", version = "0.1.1")
bazel_dep(name = "aspect_rules_lint", version = "1.4.4")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")

#docs-as-code
bazel_dep(name = "score_docs_as_code", version = "1.0.1")
git_override(
module_name = "score_docs_as_code",
commit = "13ba715a95cfe85158b60d7f4748ba8e28895d8c",
remote = "https://github.com/eclipse-score/docs-as-code.git",
)

# Provides, pytest & venv
bazel_dep(name = "score_python_basics", version = "0.3.4")
bazel_dep(name = "score_platform", version = "0.3.0")
bazel_dep(name = "score_process", version = "1.1.0")

# Testing utils dependency.
# Direct usage of tag in git_override reports false problem in editor, using hash of a tag
bazel_dep(name = "testing-utils")
git_override(
module_name = "testing-utils",
commit = "a847c7464cfa47e000141631d1223b92560d2e58", # tag v0.2.0
remote = "https://github.com/qorix-group/testing_tools.git",
)

# Module deps
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2024",
versions = ["1.91.0"],
)

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
name = "score_fault_lib_crates",
cargo_lockfile = "//:Cargo.lock",
manifests = [
"//:Cargo.toml",
],
)
use_repo(crate, "score_fault_lib_crates")

#bazel_dep on module 'rules_boost' has no version -> override needed
archive_override(
module_name = "rules_boost",
strip_prefix = "rules_boost-master",
urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
)

bazel_dep(name = "score-baselibs", version = "0.0.0")
git_override(
module_name = "score-baselibs",
commit = "46923f5c4f302bd9feae0261588687aaf32e3c5c",
remote = "https://github.com/eclipse-score/baselibs.git",
)

bazel_dep(name = "score_cli_helper", version = "0.1.2")

crate.annotation(
crate = "iceoryx2-bb-derive-macros",
patches = ["//patches:iceoryx2_bb_derive_macros_readme.patch"],
repositories = ["score_fault_lib_crates"],
)
Loading