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
6 changes: 3 additions & 3 deletions .github/actions/link-check/link_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def generate_markdown_table(broken_links: list[BrokenLink]) -> str:
def generate_issue_body(broken_links: list[BrokenLink]) -> str:
markdown_table = generate_markdown_table(broken_links)
return f"""
# Broken Links Report.
# Broken Links Report.
**Last updated: {datetime.now().strftime('%d-%m-%Y %H:%M')}**
The following broken links were detected in the documentation:
Expand All @@ -71,9 +71,9 @@ def generate_issue_body(broken_links: list[BrokenLink]) -> str:
> To test locally if all link issues are resolved use `bazel run //:docs_link_check`
---
---
This issue will be auto updated regularly if link issues are found.
You may close it if you wish, though a new one will be created if link issues are still present.
You may close it if you wish, though a new one will be created if link issues are still present.
"""

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/consumer_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
mkdir -p reports
# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
# & make the tests red in the end. Without this we only would check the exit code of the 'tee' command.
- name: Run Consumer tests

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ jobs:
repository-cache: true
bazelisk-cache: true

- name: Run Linter Script
run: bash scripts/run-linters.sh
- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit checks
run: pre-commit run -a
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- 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"]

# use LOCAL hooks for python tooling so versions come from the virtualenv
- repo: local
hooks:
- id: Linter Scripts
name: Run linter script
entry: ./scripts/run-linters.sh
language: unsupported_script
pass_filenames: false
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ If your IDE does not automatically ask you to activate the newly created environ
- In VSCode via `ctrl+p` => `Select Python Interpreter` then select `.venv_docs/bin/python`
- In the terminal via `. .venv_docs/bin/activate`


### Enabeling pre-commit

Pre-commit is supported inside docs-as-code to help with code quality and make developers workflow easier.

Install the hook:
```bash
pre-commit install

# Or install it to run on pre-push via:
pre-commit install --hook-type pre-push
```

Execute the pre-commit manually via `pre-commit`

### Format your documentation with:

```bash
Expand Down
8 changes: 4 additions & 4 deletions docs/internals/extensions/source_code_linker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(source-code-linker)=
# Score Source Code Linker

A Sphinx extension for enabling **source code and test traceability** for requirements.
A Sphinx extension for enabling **source code and test traceability** for requirements.
This extension integrates with **Bazel** and **sphinx-needs** to automatically generate traceability links between implementation, tests, and documentation.

---
Expand Down Expand Up @@ -272,9 +272,9 @@ flowchart TD
L4[DTFL = DataForTestLink]
L3[TestCaseNeed Operations]
L5[DOTC = DataOfTestCase]
L1 ~~~ L2
L2 ~~~ L4
L4 ~~~ L3
L1 ~~~ L2
L2 ~~~ L4
L4 ~~~ L3
L3 ~~~ L5
end
Expand Down
12 changes: 6 additions & 6 deletions docs/internals/requirements/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -997,16 +997,16 @@ Testing
Docs-As-Code shall enforce that needs of type :need:`tool_req__docs_saf_types` have a
`violates` links to at least one dynamic / static diagram according to the table.


.. table::
:widths: auto

============= ===================
Link Source Allowed Link Target
Link Source Allowed Link Target
============= ===================
feat_saf_dfa feat_arc_sta
comp_saf_dfa comp_arc_sta
feat_saf_fmea feat_arc_dyn
feat_saf_dfa feat_arc_sta
comp_saf_dfa comp_arc_sta
feat_saf_fmea feat_arc_dyn
comp_saf_fmea comp_arc_dyn
============= ===================

Expand Down
2 changes: 1 addition & 1 deletion scripts/run-linters.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
Expand All @@ -10,7 +11,6 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
#!/usr/bin/env bash
set -euo pipefail

bazel run //:ide_support
Expand Down
1 change: 0 additions & 1 deletion src/extensions/score_layout/assets/css/score_needs.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,3 @@ html[data-theme="light"] #logo_center_drk {
display:none;

}

Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@

.. std_wp:: This is a test
:id: std_wp__test__abce


Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"full_line": "#-----req-Id: TREQ_ID_1"
},
{
"file": "src/implementation2.py",
"file": "src/implementation2.py",
"line": 5,
"tag":"#-----req-Id:",
"need": "TREQ_ID_1",
Expand All @@ -17,7 +17,7 @@
"file": "src/implementation1.py",
"line": 9,
"tag":"#-----req-Id:",
"need": "TREQ_ID_2",
"need": "TREQ_ID_2",
"full_line":"#-----req-Id: TREQ_ID_2"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"full_line": "#-----req-Id: TREQ_ID_1"
},
{
"file": "src/implementation2.py",
"file": "src/implementation2.py",
"line": 5,
"tag":"#-----req-Id:",
"need": "TREQ_ID_1",
Expand Down Expand Up @@ -40,7 +40,7 @@
"file": "src/implementation1.py",
"line": 9,
"tag":"#-----req-Id:",
"need": "TREQ_ID_2",
"need": "TREQ_ID_2",
"full_line":"#-----req-Id: TREQ_ID_2"
}
],
Expand Down
1 change: 0 additions & 1 deletion src/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ rich
needs-config-writer == 0.2.4
# use this for a specific commit for fast development iterations
# needs-config-writer @ https://github.com/useblocks/needs-config-writer/archive/032a5f8.zip

Loading