Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make naming rules more strict #651

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions docs-gen/content/rule_set/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,38 @@ Vehicle.Navigation.CurrentLocation:

It is recommended for servers, which are implementing protocols for the vehicle signal specification, to serve old and new nodes during the deprecation period described above.

## Naming Rules

Different languages and environments have different rules for identifiers.
To simplify usage of VSS in as many languages and environments as possible the following rules apply.

* The allowed character set for node names (branch and data nodes) is `A-Z`, `a-z` and `0-9`.
* Node names must not start with a digit.
* Names are case sensitive, but it is not allowed to have two nodes that only differ by case,
i.e. it is not allowed to have both `Vehicle.Aaa` and `Vehicle.AaA`.
* It is not allowed to reuse the same node name as a parent or ancestor node for a child node,
i.e., it is not allowed to have a child `A` if the parent or any ancestor is called `A`
* For string literals only the characters `A-Z`, `0-9` and `_` are allowed,
and the value must start with `A-Z`. See the [chapter](/vehicle_signal_specification/rule_set/data_entry/allowed/) for specifying allowed values.

It is recommended that VSS Tools shall give an error if the rules above are not followed.

## Style Guide

The VSS specification must adhere to YAML syntax. To keep the standardized VSS specification in this repository consistent the following style guide is provided.
For a contribution to VSS standard catalog the following recommendations must be followed:

### Naming Conventions

The recommended naming convention for node elements is to use camel case notation starting with a capital letter. It is recommended to use only
`A-Z`, `a-z` and `0-9` in node names. For boolean signals it is recommended to start the name with `Is`.
* The recommended naming convention for node elements is to use camel case notation starting with a capital letter.
* For boolean signals it is recommended to start the name with `Is`.
* For acronyms in node names only the first letter in the acronym shall be capitalized, like `Vehicle.Adas.Abs.IsAbsEnabled`

Examples:

```
SomeBranch.AnotherBranch.MySignalName
Vehicle.Cabin.Door.Row1.Left.IsLocked
```
Naming convention for string literals can be found in the [chapter](/vehicle_signal_specification/rule_set/data_entry/allowed/)for specifying allowed values.

### Line Length

Expand Down
2 changes: 1 addition & 1 deletion docs-gen/content/rule_set/data_entry/allowed.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ in a list. Only values can be assigned to the data entry, which are
specified in this list.

The `datatype` specifier gives the type of the individual elements of the `allowed`
list. In general `allowed:` is valid for all datatypes, including integer- and float-based types, unless othwerise specified.
list. In general `allowed:` is valid for all datatypes, including integer- and float-based types, unless otherwise specified.

## Recommendation on String values

Expand Down