docs/docs/entitydb/format-rules.md

54 lines
2.1 KiB
Markdown
Raw Normal View History

# Format and Rules
## Language
In edb JSON is used to describe the entities. Each entity has a JSON file in the format: `<entity>.json`, where `<entity>` is the name of the entity. This file may contain the following characters:
- `a-z`
- `0-9`
- `_`
- `-`
The entity must not be `schema`.
## Indentation
An indentation of two spaces is used. Each entity must be formatted correctly. You can use a tool like jq or [jsonlint.com](https://jsonlint.com/) for this.
## Format verification
In the `schema.json` a schema with the format for the JSON files is defined. A check can be done for example with the Python tool `check-jsonschema`:
```
check-jsonschema --schemafile schema.json entity.json
```
## Availability
The edb is hosted by [Codeberg](https://codeberg.org/). The edb uses git for version control.
## Propose changes / registration
To propose a change or to register in the edb, you have to fork the repository, make your changes and then request a PR.
## Scripts
The edb repository currently contains two different scripts:
| `test.sh` | Tests the JSON files for validity |
| `build_maxlen_filter.sh` | Builds a bird-compatible filter list |
## Do I need to sqash my commits before setting a PR?
Yes and No. Changes to files should be traceable. Therefore, a commit is recommended for every change. However, we also want to avoid more than 30 commits for one file in one PR. Therefore, if there are still mistakes in the initial registration, it would be nice to keep the number of commits within limits.
With the following commands you can squash two commits to one:
```
git rebase -i HEAD~2
```
Replace the second `pick` with `s` or `squash`. Save the file and exit.
Enter your new commit message. Save the file and exit.
Sign the commit with the following command:
```
git commit --amend -s -S
```
After that you can upload the changes. If the Git server rejects the changes, you can use the following command:
```
git push -f
```
## License
The edb is available under the AGPL v3 license. More information is available in the `LICENSE.md` in the repository of the edb.