Skip to content

Add YAML Formatting Job#3889

Merged
patel-bhavin merged 19 commits intodevelopfrom
add-yaml-fmt
Feb 25, 2026
Merged

Add YAML Formatting Job#3889
patel-bhavin merged 19 commits intodevelopfrom
add-yaml-fmt

Conversation

@nasbench
Copy link
Contributor

@nasbench nasbench commented Feb 3, 2026

This PR introduces a new CI, validation scrip and a pre-commit hook for YAML linting and validation.

It uses both yamllint and yamlfmt to apply and verify yaml formatting and linting.

Yamlfmt

We use yamlfmt to apply formatting. A new config has been added in .yamlfmt that ensures all the yaml has proper indentation and array nesting.

Yamllint

We had to use yamlfmt since yamllint's ability/support for nested arrays is tricky to accommodate our format. Hence it's usage is for the other linting functionalities like duplicate keys and what not.

Pre-commit Hook

A new pre-commit hook was introduced that apply that yamlfmt with the config to all yaml files sitting in the detections folder.

New CI Job - Yaml Validation

A new CI job was added with a wrapper script validate_yaml.py that checks both configs mentioned above are applied.

Docs

New documentation has been added describing how to use all of this in the docs/ci folder.

Changed Analytics

All the analytics residing in the detections folder have been touched and formatted accordingly.

In addition to this a custom SPL search beautifying script (local) has been applied to all searches to make them use the |- notation as well as make them more readable.

This is only an initial effort to beautify the SPL. Since it is tricky to solve this for all generically, we will need to iterate on this a bit more.


Note for reviewers inspect the following commits de0d0ff and 734090a to verify the logic of the job and scripts to avoid confusion with the other many changes.

- Add yamlfmt configuration (.yamlfmt) with 4-space indent, LF line endings
- Add yamllint configuration (.yamllint) for syntax validation (detections/ only)
- Add pre-commit hook for automatic YAML formatting
- Add CI validation script with unified error output
- Add GitHub Actions workflow for PR validation
- Add documentation for setup and usage
- Support custom yamlfmt binary path via --yamlfmt-path flag
@nasbench
Copy link
Contributor Author

nasbench commented Feb 5, 2026

Versioning and the CI failure will be addressed after the release.

@nasbench nasbench marked this pull request as ready for review February 5, 2026 22:43
@patel-bhavin
Copy link
Contributor

patel-bhavin commented Feb 6, 2026

@nasbench - lets add a short update to the main read me as step 2 to install pre commit hook! other than that, LGTM!

@nasbench nasbench added this to the v5.23.0 milestone Feb 17, 2026
@nasbench
Copy link
Contributor Author

@nasbench - lets add a short update to the main read me as step 2 to install pre commit hook! other than that, LGTM!

I have updated the Getting Started section to include a hint about installing the pre-commit hook

@nasbench
Copy link
Contributor Author

@patel-bhavin things should be green now. The unit-testing will fail due to the big changes. If you can double check again the overall structure and changes. We merge this and then we can run an internal build to see if things broke. Let me know

@nasbench
Copy link
Contributor Author

Integration errors found internally were fixed in #3920

@patel-bhavin
Copy link
Contributor

tested the precommit and the changes in the file : Formatting looks crisp! Lets make sure everybody installs these hooks ;)

image

@patel-bhavin patel-bhavin merged commit 11c909f into develop Feb 25, 2026
5 of 6 checks passed
@patel-bhavin patel-bhavin deleted the add-yaml-fmt branch February 25, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants