Skip to content

Commit c81b2d4

Browse files
Merge branch 'main' into Aymen-Soussi-01-fix-and-remove-gitlint-action-file
2 parents f660e30 + af8207b commit c81b2d4

11 files changed

Lines changed: 176 additions & 9 deletions

File tree

.github/workflows/format.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ jobs:
2727
uses: bazel-contrib/setup-bazel@0.9.1
2828
- name: Run formatting checks
2929
run: |
30+
bazel run //src:ide_support
3031
bazel test //src:format.check

.github/workflows/license_check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ jobs:
2828
uses: eclipse-score/cicd-workflows/.github/workflows/license-check.yml@main
2929
with:
3030
repo-url: "${{ github.server_url }}/${{ github.repository }}"
31+
bazel-target: "run //src:license-check"
3132
secrets:
3233
dash-api-token: ${{ secrets.ECLIPSE_GITLAB_API_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ jobs:
2323
uses: actions/checkout@v4.2.2
2424
- name: Run test targets
2525
run: |
26+
bazel run //src:ide_support
2627
bazel test ...

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
module(
1515
name = "score_docs_as_code",
16-
version = "0.2.0",
16+
version = "0.2.1",
1717
compatibility_level = 0,
1818
)
1919

docs.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
# For user-facing documentation, refer to `/README.md`.
3939

4040
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_library")
41-
load("@score_docs_as_code//src/extensions/score_source_code_linker:collect_source_files.bzl", "parse_source_files_for_needs_links")
4241
load("@pip_process//:requirements.bzl", "all_requirements", "requirement")
4342
load("@rules_java//java:java_binary.bzl", "java_binary")
4443
load("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
4544
load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
45+
load("@score_docs_as_code//src/extensions/score_source_code_linker:collect_source_files.bzl", "parse_source_files_for_needs_links")
4646
load("@score_python_basics//:defs.bzl", "score_virtualenv")
4747

4848
sphinx_requirements = all_requirements + [
@@ -158,7 +158,7 @@ def _ide_support():
158158
reqs = sphinx_requirements,
159159
)
160160

161-
def _docs(name = "docs", format = "html", external_needs_deps = list(), external_needs_def = dict()):
161+
def _docs(name = "docs", format = "html", external_needs_deps = list(), external_needs_def = list()):
162162
ext_needs_arg = "--define=external_needs_source=" + json.encode(external_needs_def)
163163

164164
sphinx_docs(

docs/BUILD

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("@aspect_rules_py//py:defs.bzl", "py_library")
15+
load("//:docs.bzl", "docs")
16+
17+
# Creates all documentation targets:
18+
# - `docs:incremental` for building docs incrementally at runtime
19+
# - `docs:live_preview` for live preview in the browser without an IDE
20+
# - `docs:ide_support` for creating python virtualenv for IDE support
21+
# - `docs:docs` for building documentation at build-time
22+
23+
docs(
24+
conf_dir = "docs",
25+
docs_targets = [
26+
{
27+
"suffix": "latest", # latest main branch documentation build
28+
"external_needs_info": [
29+
{
30+
"base_url": "https://eclipse-score.github.io/score/main/",
31+
"json_url": "https://eclipse-score.github.io/score/main/needs.json",
32+
"version": "0.1",
33+
"id_prefix": "score_",
34+
},
35+
],
36+
},
37+
],
38+
source_dir = "docs",
39+
source_files_to_scan_for_needs_links = [
40+
# Note: you can add filegroups, globs, or entire targets here.
41+
"//src:score_extension_files",
42+
],
43+
)
44+
45+
# ╭───────────────────────────────────────╮
46+
# │ This is commented out until local │
47+
# │ multi-repo testing is implemented │
48+
# ╰───────────────────────────────────────╯
49+
50+
# {
51+
# "suffix": "release", # The version imported from MODULE.bazel
52+
# "target": ["@score_platform//docs:docs"],
53+
# "external_needs_info": [
54+
# {
55+
# "base_url": "https://eclipse-score.github.io/score/pr-980/",
56+
# "json_path": "/score_platform~/docs/docs/_build/html/needs.json",
57+
# "version": "0.1",
58+
# },
59+
# ],
60+
# },

docs/conf.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
# Configuration file for the Sphinx documentation builder.
15+
#
16+
# For the full list of built-in configuration values, see the documentation:
17+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
22+
23+
project = "Simple Example Project"
24+
author = "S-CORE"
25+
version = "0.1"
26+
27+
# -- General configuration ---------------------------------------------------
28+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
29+
30+
31+
extensions = [
32+
"sphinx_design",
33+
"sphinx_needs",
34+
"sphinxcontrib.plantuml",
35+
"score_plantuml",
36+
"score_metamodel",
37+
"score_draw_uml_funcs",
38+
"score_source_code_linker",
39+
"score_layout",
40+
]
41+
42+
exclude_patterns = [
43+
# The following entries are not required when building the documentation via 'bazel
44+
# build //docs:docs', as that command runs in a sandboxed environment. However, when
45+
# building the documentation via 'bazel run //docs:incremental' or esbonio, these
46+
# entries are required to prevent the build from failing.
47+
"bazel-*",
48+
".venv_docs",
49+
]
50+
51+
templates_path = ["templates"]
52+
53+
# Enable numref
54+
numfig = True

docs/index.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
..
2+
# *******************************************************************************
3+
# Copyright (c) 2024 Contributors to the Eclipse Foundation
4+
#
5+
# See the NOTICE file(s) distributed with this work for additional
6+
# information regarding copyright ownership.
7+
#
8+
# This program and the accompanying materials are made available under the
9+
# terms of the Apache License Version 2.0 which is available at
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
15+
Hello World
16+
=================
17+
This is a simple example of a documentation page using the `docs` tool.
18+
19+
.. stkh_req:: TestTitle
20+
:id: stkh_req__test_requirement
21+
:status: valid
22+
:safety: QM
23+
:rationale: A simple requirement we need to enable a documentation build
24+
:reqtype: Functional
25+
26+
Some content to make sure we also can render this
27+
This is a link to an external need inside the 'score' documentation
28+
:need:`SCORE_gd_req__req__attr_safety`
29+

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is at the root level, as it applies to all Python code,
22
# not only to docs or to tools.
33
[tool.pyright]
4-
extends = "bazel-bin/examples/simple/ide_support.runfiles/score_python_basics~/pyproject.toml"
4+
extends = "bazel-bin/src/ide_support.runfiles/score_python_basics~/pyproject.toml"
55

66
exclude = [
77
"**/__pycache__",
@@ -11,7 +11,7 @@ exclude = [
1111
]
1212

1313
[tool.ruff]
14-
extend = "bazel-bin/examples/simple/ide_support.runfiles/score_python_basics~/pyproject.toml"
14+
extend = "bazel-bin/src/ide_support.runfiles/score_python_basics~/pyproject.toml"
1515

1616
extend-exclude = [
1717
"**/__pycache__",

src/BUILD

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13-
1413
load("@aspect_rules_lint//format:defs.bzl", "format_multirun", "format_test")
1514
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_library")
1615
load("@pip_process//:requirements.bzl", "all_requirements", "requirement")
@@ -19,7 +18,20 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
1918
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
2019
load("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary")
2120
load("@score_dash_license_checker//:dash.bzl", "dash_license_checker")
22-
21+
load("@score_python_basics//:defs.bzl", "score_virtualenv")
22+
23+
score_virtualenv(
24+
reqs = [
25+
"@score_docs_as_code//src:plantuml_for_python",
26+
"@score_docs_as_code//src/extensions:score_plantuml",
27+
"@score_docs_as_code//src/find_runfiles:find_runfiles",
28+
"@score_docs_as_code//src/extensions/score_draw_uml_funcs:score_draw_uml_funcs",
29+
"@score_docs_as_code//src/extensions/score_header_service:score_header_service",
30+
"@score_docs_as_code//src/extensions/score_layout:score_layout",
31+
"@score_docs_as_code//src/extensions/score_metamodel:score_metamodel",
32+
"@score_docs_as_code//src/extensions/score_source_code_linker:score_source_code_linker",
33+
] + all_requirements,
34+
)
2335
# These are only exported because they're passed as files to the //docs.bzl
2436
# macros, and thus must be visible to other packages. They should only be
2537
# referenced by the //docs.bzl macros.
@@ -135,7 +147,7 @@ filegroup(
135147

136148
dash_license_checker(
137149
src = ":requirements_lock",
138-
file_type = "requirements", # let it auto-detect based on project_config
150+
file_type = "requirements",
139151
visibility = ["//visibility:public"],
140152
)
141153

0 commit comments

Comments
 (0)