What xstyle reads, writes and runsCe que xstyle lit, écrit et lance
Every file xstyle may change, every command it starts, and what it never does.Chaque fichier que xstyle peut modifier, chaque commande qu'il lance, et ce qu'il ne fait jamais.
xstyle is a local tool: it reads source files, and changes them only when asked.
xstyle est un outil local : il lit des fichiers source, et ne les modifie que sur demande.
1. What it readsCe qu'il lit
| Read | Why |
|---|---|
| the files given (or found under the paths) | the check itself |
the root CMakeLists.txt, the includes | is libutils used, which sections |
| the installed libutils headers | the LU-* rules and the migration names |
VERSION.md of the libutils skill, the libutils clone ($LIBUTILS, else ~/personal_delivery/cpp/libutils) | only --libutils-check |
| Lu | Pourquoi |
|---|---|
| les fichiers donnés (ou trouvés sous les chemins) | la vérification elle-même |
le CMakeLists.txt racine, les includes | libutils est-elle utilisée, quelles sections |
| les headers de libutils installés | les règles LU-* et les noms de migration |
VERSION.md du skill libutils, le clone de libutils ($LIBUTILS, sinon ~/personal_delivery/cpp/libutils) | seulement --libutils-check |
2. What it writesCe qu'il écrit
Without --fix and -o, xstyle writes nothing.
| Written | When |
|---|---|
| the checked files | --fix only, never with -n / --dry-run |
| the report file | -o <file> (.txt, .md, .json) |
R34.md in the working directory | --fix --force, never over an existing file |
| a git commit | --fix --commit / --commit-all only |
Sans --fix ni -o, xstyle n'écrit rien.
| Écrit | Quand |
|---|---|
| les fichiers vérifiés | --fix seulement, jamais avec -n / --dry-run |
| le fichier de rapport | -o <fichier> (.txt, .md, .json) |
R34.md dans le dossier courant | --fix --force, jamais par-dessus un fichier existant |
| un commit git | --fix --commit / --commit-all seulement |
3. What it runsCe qu'il lance
Only git, in the repository of the checked files, started directly (no shell):
| Command | For |
|---|---|
git rev-parse --show-toplevel | find the repository |
git diff -U0 --no-color --no-ext-diff --no-renames, git ls-files --others --exclude-standard | --diff, --diff-ref, --staged |
git status --porcelain | the files already changed before --commit |
git add, git commit -q -m <message> | --commit, --commit-all |
git rev-list --count in the libutils clone | --libutils-check |
No network access, no shell command built from a file, no code of the checked project executed.
Seulement git, dans le dépôt des fichiers vérifiés, lancé directement (sans shell) :
| Commande | Pour |
|---|---|
git rev-parse --show-toplevel | trouver le dépôt |
git diff -U0 --no-color --no-ext-diff --no-renames, git ls-files --others --exclude-standard | --diff, --diff-ref, --staged |
git status --porcelain | les fichiers déjà modifiés avant --commit |
git add, git commit -q -m <message> | --commit, --commit-all |
git rev-list --count dans le clone de libutils | --libutils-check |
Aucun accès réseau, aucune commande shell construite depuis un fichier, aucun code du projet vérifié exécuté.
4. Fixes that change behaviorCorrections qui changent le comportement
Warning. --force and --dangerous-force can change what the code does: set -euo pipefail stops a script at the first failing command, encoding="utf-8" makes a file in another encoding fail, a guessed type can be wrong. Preview them with -n, then review the result with git diff.
--commit never takes a file that had changes before the fixes: its own changes would end up in the commit unseen.
Attention. --force et --dangerous-force peuvent changer ce que fait le code : set -euo pipefail arrête un script à la première commande en échec, encoding="utf-8" fait échouer un fichier dans un autre encodage, un type deviné peut être faux. Les prévisualiser avec -n, puis relire le résultat avec git diff.
--commit ne prend jamais un fichier qui avait des modifications avant les corrections : ses propres modifications finiraient dans le commit sans être vues.