Skip to content

Commit 86c06f5

Browse files
author
Arnaud Riess
committed
fix: update copyright year in source files and README
1 parent 49bc9ca commit 86c06f5

6 files changed

Lines changed: 33 additions & 34 deletions

File tree

src/extensions/score_metamodel/sn_schemas.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *******************************************************************************
2-
# Copyright (c) 2026 Contributors to the Eclipse Foundation
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
33
#
44
# See the NOTICE file(s) distributed with this work for additional
55
# information regarding copyright ownership.
@@ -72,7 +72,6 @@ def write_sn_schemas(app: Sphinx, metamodel: MetaModelData) -> None:
7272

7373
# Tell sphinx-needs to load the schema from the JSON file
7474
config.needs_schema_definitions_from_json = "schemas.json"
75-
# config.needs_schema_definitions = schema_definitions
7675

7776

7877
def _classify_links(
@@ -173,7 +172,6 @@ def _build_local_validator(
173172
return {
174173
"properties": properties,
175174
"required": required,
176-
# "unevaluatedProperties": False,
177175
}
178176

179177

src/extensions/score_metamodel/tests/test_sn_schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *******************************************************************************
2-
# Copyright (c) 2026 Contributors to the Eclipse Foundation
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
33
#
44
# See the NOTICE file(s) distributed with this work for additional
55
# information regarding copyright ownership.

src/extensions/score_metamodel/tests/test_sn_schemas_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *******************************************************************************
2-
# Copyright (c) 2026 Contributors to the Eclipse Foundation
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
33
#
44
# See the NOTICE file(s) distributed with this work for additional
55
# information regarding copyright ownership.

src/extensions/score_sync_toml/README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ The static `shared.toml` is always merged into the output. It contributes:
5757
JSON Schema validation file generated by `score_metamodel`.
5858
- **`index_on_save = true`** — tells ubCode to re-index whenever a file is saved.
5959

60-
### 4. `_write_needs_types_toml(app)` — generating `[[needs.types]]`
60+
### 4. `_generate_needs_types_toml(app)` — generating `[[needs.types]]`
6161

6262
`needs_config_writer` cannot serialise the project's custom `ScoreNeedType` dicts
6363
(they contain Python-specific data) and silently skips them. Without
6464
`[[needs.types]]` entries in `ubproject.toml`, **ubCode does not recognise any
6565
directives as needs** and the index is empty.
6666

67-
`_write_needs_types_toml` works around this by:
67+
`_generate_needs_types_toml` works around this by:
6868

6969
1. Reading `app.config.needs_types` — already populated by `score_metamodel` from
7070
`metamodel.yaml` before `score_sync_toml` runs.
71-
2. Writing `needs_types_generated.toml` next to `conf.py` containing clean
72-
`[[needs.types]]` entries with only the fields ubCode requires:
73-
`directive`, `title`, `prefix`, and optionally `color` / `style`.
74-
3. Appending that file to `needscfg_merge_toml_files` so it is merged into the
71+
2. Generating the `[[needs.types]]` TOML entries in memory with only the fields
72+
ubCode requires: `directive`, `title`, `prefix`, and optionally `color` / `style`.
73+
3. Writing the result (combined with fields and links) into a temporary file and
74+
appending it to `needscfg_merge_toml_files` so it is merged into the
7575
final `ubproject.toml`.
7676

7777
### 5. Relative path handling
@@ -101,20 +101,22 @@ metamodel.yaml
101101
score_metamodel.setup() ──► app.config.needs_types (Python objects)
102102
103103
104-
_write_needs_types_toml()
104+
_generate_needs_types_toml()
105+
_generate_needs_fields_toml()
106+
_generate_needs_links_toml()
105107
106108
107-
needs_types_generated.toml ──┐
108-
109-
shared.toml ────────────────────────────────────────────┤ merge via
110-
│ needs_config_writer
111-
app.config (all other needs_* settings) ────────────────┤
112-
113-
ubproject.toml
114-
115-
116-
Sphinx-Needs
117-
ubCode language server
109+
<temp file>.toml ──────────────────┐
110+
111+
shared.toml ──────────────────────────────────────────────────┤ merge via
112+
│ needs_config_writer
113+
app.config (all other needs_* settings) ──────────────────────
114+
115+
ubproject.toml
116+
117+
118+
Sphinx-Needs
119+
ubCode language server
118120
```
119121

120122
---
@@ -129,4 +131,3 @@ build first.
129131
|---|---|---|
130132
| `ubproject.toml` | `needs_config_writer` + merges above | ubCode language server |
131133
| `schemas.json` | `score_metamodel.sn_schemas.write_sn_schemas` | ubCode + sphinx-needs schema validation |
132-
| `needs_types_generated.toml` | `_write_needs_types_toml` | Merged into `ubproject.toml`, not committed |

src/extensions/score_sync_toml/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,24 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
111111
See https://needs-config-writer.useblocks.com
112112
"""
113113

114+
# Write to the confdir directory.
114115
config_setdefault(app.config, "needscfg_outpath", "ubproject.toml")
115-
"""Write to the confdir directory."""
116116

117+
# Any changes to the shared/local configuration updates the generated config.
117118
config_setdefault(app.config, "needscfg_overwrite", True)
118-
"""Any changes to the shared/local configuration updates the generated config."""
119119

120+
# Write full config, so the final configuration is visible in one file.
120121
config_setdefault(app.config, "needscfg_write_all", True)
121-
"""Write full config, so the final configuration is visible in one file."""
122122

123+
# Exclude default values from the generated configuration.
123124
config_setdefault(app.config, "needscfg_exclude_defaults", True)
124-
"""Exclude default values from the generated configuration."""
125125

126126
# This is disabled for right now as it causes a lot of issues
127127
# While we are not using the generated file anywhere
128+
# Running Sphinx with -W will fail the CI for uncommitted TOML changes.
128129
config_setdefault(app.config, "needscfg_warn_on_diff", False)
129-
"""Running Sphinx with -W will fail the CI for uncommitted TOML changes."""
130130

131+
# Exclude resolved/generated config values that don't belong in ubproject.toml.
131132
app.config.needscfg_exclude_vars = [
132133
# Default exclusions from needs-config-writer
133134
"needs_from_toml",
@@ -142,12 +143,11 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
142143
# needs_config_writer emits unsupported_type warnings for these and skips them.
143144
"needs_render_context",
144145
]
145-
"""Exclude resolved/generated config values that don't belong in ubproject.toml."""
146146

147+
# Merge the static TOML file into the generated configuration.
147148
app.config.needscfg_merge_toml_files.append(
148149
str(Path(__file__).parent / "shared.toml")
149150
)
150-
"""Merge the static TOML file into the generated configuration."""
151151

152152
# Generate TOML fragments for types, fields, and links from the metamodel.
153153
# needs_config_writer cannot serialise these structures itself, so we combine
@@ -163,9 +163,10 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
163163
mode="w", suffix=".toml", delete=False, encoding="utf-8"
164164
) as tmp:
165165
tmp.write(metamodel_toml)
166+
# Merge the generated metamodel TOML (types, fields, links) into the final ubproject.toml.
166167
app.config.needscfg_merge_toml_files.append(tmp.name)
167-
"""Merge the generated metamodel TOML (types, fields, links) into the final ubproject.toml."""
168168

169+
# Relative paths to confdir for Bazel provided absolute paths.
169170
app.config.needscfg_relative_path_fields.extend(
170171
[
171172
"needs_external_needs[*].json_path",
@@ -175,7 +176,6 @@ def setup(app: Sphinx) -> dict[str, str | bool]:
175176
},
176177
]
177178
)
178-
"""Relative paths to confdir for Bazel provided absolute paths."""
179179

180180
app.config.suppress_warnings += [
181181
"needs_config_writer.path_conversion",

src/extensions/score_sync_toml/shared.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ parse_content = false
2020
content_required = false
2121

2222
[needs]
23-
schema_definitions_from_json="schemas.json"
23+
schema_definitions_from_json = "schemas.json"
2424

2525
[server]
2626
index_on_save = true

0 commit comments

Comments
 (0)