Merge branch 'feature/template-safety-and-formatting' into develop
This commit is contained in:
commit
df350afa35
10 changed files with 84 additions and 6 deletions
29
.editorconfig
Normal file
29
.editorconfig
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
root = true
|
||||
|
||||
# Whitespace / EOL / indent per TUTTI i tipi — cross-editor, zero dipendenze.
|
||||
# Non tocca mai il CONTENUTO (quindi i placeholder {{...}} sono al sicuro qui).
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Markdown: preserva i "due spazi" di fine riga (hard break) → non trimmare.
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{sh,bash}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{py,pyi}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{yml,yaml,json}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# VS Code — only shared workspace settings
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/extensions.json
|
||||
8
.prettierignore
Normal file
8
.prettierignore
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Template engine — contengono i placeholder {{...}}: NON formattare mai.
|
||||
templates/
|
||||
|
||||
# Contenuto di proprietà dell'agente / generato (di norma in repo separati,
|
||||
# elencato qui per sicurezza se apri un genoma nello stesso workspace).
|
||||
wiki/
|
||||
genomes/
|
||||
raw/
|
||||
5
.prettierrc
Normal file
5
.prettierrc
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"proseWrap": "preserve"
|
||||
}
|
||||
8
.vscode/extensions.json
vendored
Normal file
8
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"esbenp.prettier-vscode",
|
||||
"editorconfig.editorconfig",
|
||||
"timonwong.shellcheck"
|
||||
],
|
||||
"unwantedRecommendations": ["dbaeumer.vscode-eslint", "ms-vscode.vscode-typescript-next"]
|
||||
}
|
||||
18
.vscode/settings.json
vendored
Normal file
18
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"editor.formatOnSave": true,
|
||||
"prettier.requireConfig": true,
|
||||
|
||||
"files.associations": {
|
||||
"templates/**/*.md": "plaintext"
|
||||
},
|
||||
|
||||
"[markdown]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,12 @@ render_template() {
|
|||
local content
|
||||
content=$(<"$template_file")
|
||||
|
||||
# HARDENING: collapse any “spaced” placeholders from a formatter
|
||||
# { { KEY } } -> {{KEY}} (KEY = UPPERCASE/underscore)
|
||||
# Defense in depth: if Prettier or a copy-paste breaks the syntax again,
|
||||
# the scaffold fixes itself. sed is a core utility (like tr/date already used here).
|
||||
content=$(sed -E 's/\{[[:space:]]*\{[[:space:]]*([A-Z_]+)[[:space:]]*\}[[:space:]]*\}/{{\1}}/g' <<<"$content")
|
||||
|
||||
# Defaults (:-) so master-repo templates render even when GENOME_* are unset
|
||||
# (scaffold_master runs before any genome; set -u would otherwise abort here).
|
||||
local genome_name_upper
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ Required on every wiki page:
|
|||
---
|
||||
title: "Strict String Title"
|
||||
type: source | entity | concept | query | conflict | private
|
||||
domain: { { GENOME_NAME } }
|
||||
domain: {{ GENOME_NAME }}
|
||||
tags: [lowercase, hyphen-separated]
|
||||
maturity: draft | stable | deprecated
|
||||
last_updated: YYYY-MM-DD
|
||||
|
|
@ -205,7 +205,7 @@ When new evidence contradicts an existing wiki claim:
|
|||
---
|
||||
title: "Conflict: <concept>"
|
||||
type: conflict
|
||||
domain: { { GENOME_NAME } }
|
||||
domain: {{ GENOME_NAME }}
|
||||
maturity: draft
|
||||
last_updated: YYYY-MM-DD
|
||||
private: false
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: "Index — {{GENOME_NAME}}"
|
||||
type: index
|
||||
domain: { { GENOME_NAME } }
|
||||
domain: {{ GENOME_NAME }}
|
||||
maturity: stable
|
||||
last_updated: { { DATE } }
|
||||
last_updated: {{ DATE }}
|
||||
private: false
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: "Operations Log — {{GENOME_NAME}}"
|
||||
type: log
|
||||
domain: { { GENOME_NAME } }
|
||||
domain: {{ GENOME_NAME }}
|
||||
maturity: stable
|
||||
last_updated: { { DATE } }
|
||||
last_updated: {{ DATE }}
|
||||
private: false
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue