naming
What it means#
A name not in its case (archec vet): PascalCase for definitions, systems and types, snake_case for parts, ports, functions and variables, SCREAMING_CASE for messages, constants and literals; requirement ids upper-case.
In detail#
A name's case says what it is, as in Go:
| What | Case | Example |
|---|---|---|
| a definition, a system, a type, an interface | PascalCase |
BrakeEcu, Car, Speed |
| a part, a port, a function, a variable | snake_case |
brakes, can0, regulate, target_speed |
| a message, a constant, an enum literal | SCREAMING_CASE |
BRAKE_CMD, MAX_SPEED, AUTONOMOUS |
| a requirement, a test plan, a case | as its document writes it | REQ-BRK-001, TP-AEB, TC-AEB-01 |
An imported name keeps its Arche id with as, for example
component flash_memory "FLASH" as c-1793752253957. To rename, use the editor
(F2): every use follows.
How to fix it#
The message says what is wrong and where, and often what was meant (Did you mean …?). Change the model so that what this page describes no longer holds, then check again: archec check main.arche.
A hint: a suggestion; the model builds as it is.
A style finding: archec vet reports it, archec check does not; archec fmt --write writes the layout ones.
archec check --beginner says the most common messages in plain words, with the names that exist.
The automatic fix#
The name is changed to the naming convention, with every use (offered). The editor's rename also renames the uses in Python. archec fix --only naming renames the uses in the model.
It guesses what to write, or removes something: VS Code offers it (Quick Fix), and archec fix leaves it unless you name its code — archec fix main.arche --only naming.
In the terminal#
archec explain naming prints this explanation; archec explain style lists the codes of its area.