Skip to content

Commit 783f20c

Browse files
Arnaud RiessCopilot
andcommitted
docs: update README.md to clarify file generation process and avoid temporary files
Co-authored-by: Copilot <copilot@github.com>
1 parent 5282209 commit 783f20c

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/extensions/score_metamodel/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ Schema column: **yes** = implemented, **feasible** = could be added, **--** = no
9999
| Mandatory link ID regex | feasible | yes | Can add `items.pattern` in local; TODO in code |
100100
| Optional link target type | feasible | yes (info) | Split into separate schema with `severity: "info"` |
101101
| Optional link ID regex | feasible | yes (info) | Same split-severity approach |
102-
| Mixed regex+plain link type | -- | yes | `ValidateSchemaType` has no `anyOf`/`oneOf` |
102+
| Mixed regex+plain link type | to be analyzed | yes | `ValidateSchemaType` has no `anyOf`/`oneOf` |
103103
| ID structure (parts count) | feasible | yes | Per-type pattern from `parts` field; cannot check file-path part |
104104
| Prohibited words | feasible | yes | Negative lookahead regex on `title`; less precise than Python |
105-
| Graph constraints | -- | yes | Cross-need traversals beyond JSON Schema |
106-
| Undefined extra options | -- | yes | `unevaluatedProperties` would reject sphinx-needs internal fields |
105+
| Graph constraints | to be analyzed | yes | Cross-need traversals beyond JSON Schema |
106+
| Undefined extra options | to be analyzed | yes | `unevaluatedProperties` would reject sphinx-needs internal fields |
107107
| ID length limit (45 chars) | feasible | yes | Can add `maxLength` to per-type ID pattern in schema |
108-
| Validity period consistency (`valid_from` < `valid_until`) | -- | yes | Cross-field comparison beyond JSON Schema |
108+
| Validity period consistency (`valid_from` < `valid_until`) | to be analyzed | yes | Cross-field comparison beyond JSON Schema |
109109

110110
#### Rule explanations
111111

src/extensions/score_sync_toml/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ directives as needs** and the index is empty.
7070
`metamodel.yaml` before `score_sync_toml` runs.
7171
2. Generating the `[[needs.types]]` TOML entries in memory with only the fields
7272
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
75-
final `ubproject.toml`.
73+
3. Writing the result (combined with fields and links) to
74+
`needs_metamodel_generated.toml` in `confdir` and appending it to
75+
`needscfg_merge_toml_files` so it is merged into the final `ubproject.toml`.
76+
A deterministic path is used so the file is always overwritten and no
77+
temporary files accumulate.
7678

7779
### 5. Relative path handling
7880

@@ -106,7 +108,7 @@ score_metamodel.setup() ──► app.config.needs_types (Python objects)
106108
_generate_needs_links_toml()
107109
108110
109-
<temp file>.toml ──────────────────┐
111+
needs_metamodel_generated.toml ───────────┐
110112
111113
shared.toml ──────────────────────────────────────────────────┤ merge via
112114
│ needs_config_writer
@@ -123,11 +125,12 @@ app.config (all other needs_* settings) ─────────────
123125

124126
## Generated files
125127

126-
Both files are written to `confdir` (the `docs/` directory) on every Sphinx build
127-
and are committed to the repository so that ubCode works without needing to run a
128-
build first.
128+
All three files are written to `confdir` (the `docs/` directory) on every Sphinx
129+
build and are committed to the repository so that ubCode works without needing to
130+
run a build first.
129131

130132
| File | Generated by | Used by |
131133
|---|---|---|
132134
| `ubproject.toml` | `needs_config_writer` + merges above | ubCode language server |
133135
| `schemas.json` | `score_metamodel.sn_schemas.write_sn_schemas` | ubCode + sphinx-needs schema validation |
136+
| `needs_metamodel_generated.toml` | `score_sync_toml` (`_generate_needs_types_toml` etc.) | Intermediate merge input for `needs_config_writer` |

0 commit comments

Comments
 (0)