Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate that telemetry definitions are ordered alphabetically; Reord…
…er the current file (#705) ## Problem Metrics are defined in haphazard order in the telemetry definitions file. This makes it challenging to locate entries, particularly those sharing a common prefix. Maintaining sorted lists also makes it easier to reason about entries being added or modified, without having to think about their location. ## Solution Scripting has been created to: - test that the definition file is arranged in alphabetical order - automatically rearrange the file's entries in alphabetical order A CI job has been set up to run the validation check during PRs This change was not wired up as a commit hook, because the repo does not have a top level node project. The CI job, and the readme are the mechanisms used to maintain the file going forward. I chose not to use eslint. I started out in that direction, but it was becoming more of a distraction from the problem being solved. From https://github.com/azeemba/eslint-plugin-json?tab=readme-ov-file#is-eslint-really-the-best-tool-to-lint-my-json: > Is **eslint** really the best tool to lint my JSON? > Not really. `eslint` plugin interface wasn't designed to lint a completely different language but its interface is flexible enough to allow it. So this plugin is certainly unusual. I ran the fix script against the current definitions file. This PR also contains that change as a separate commit. To verify this change, I ran the new fix script on the current telemetry file. I then hand sorted the same file, and verified that the resulting file matched what the script produced.
- Loading branch information