From e25fd0dc8c61263104d8a90b35bf82f266ba5c28 Mon Sep 17 00:00:00 2001 From: Sjur Fredriksen Date: Fri, 3 May 2024 10:01:31 +0200 Subject: [PATCH] docs: add info om data validation in readme --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 74d52fab..d433c5c4 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,25 @@ definitions. ## Contributing See CONTRIBUTING.md for more details on how to contribute. -This library is maintained by NRK and has focus on Broadcast devices. \ No newline at end of file +This library is maintained by NRK and has focus on Broadcast devices. + +## Data Validation / Commit Quality Checks + +There are two ways this repo focuses on keeping quality device-type definitions: + +- **Pre-Commit Checks** - Optional, but **highly recommended**, for helping to identify simple issues before committing. (trailing-whitespace, end-of-file-fixer, check-yaml, yamlfmt, yamllint) + - Installation + - Virtual Environment Route + - It is recommended to create a virtual env for your repo (`python3 -m venv venv`) + - Install the required pip packages (`pip install -r requirements.txt`) + - Continue to the "Install `pre-commit` Hooks" + - `pre-commit` Only Route + - [Install pre-commit](https://pre-commit.com/#install) (`pip install pre-commit`) + - Install `pre-commit` Hooks + - To install the pre-commit script: `pre-commit install` + - Usage & Useful `pre-commit` Commands + - After staging your files with `git`, to run the pre-commit script on changed files: `pre-commit run` + - To run the pre-commit script on all files: `pre-commit run --all` + - To uninstall the pre-commit script: `pre-commit uninstall` + - Learn more about [pre-commit](https://pre-commit.com/) +- **GitHub Actions** - Automatically run before a PR can be merged. Repeats yamllint & validates against NetBox Device-Type Schema.