Skip to content

Conversation

@badboy
Copy link
Member

@badboy badboy commented Jan 16, 2026

Just to know how hard it would be I implemented the lint that checks our metrics reference stays sorted.
Implemented as a test and calling git for the diff.
That automatically gives us the correct ordering by just running the test too.

wdyt, @chutten ?

@badboy badboy requested a review from chutten January 16, 2026 09:46
@badboy badboy requested a review from a team as a code owner January 16, 2026 09:46
@badboy badboy force-pushed the push-muxyskmkptwv branch from 832817f to 906a996 Compare January 16, 2026 10:54
Copy link
Contributor

@chutten chutten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if I have this sorted:

  • Add in test-only deps for reading markdown (commonmark dialect) and calling out to shell.
  • New test that
    • parses the metrics index's markdown until it finds the first list
    • removes the list
    • reprints the list after sorting it in a custom way (case-insensitive, putting labeled below unlabeled, dual-labeled below labeled, string_list below string)
    • dumps the rest of the doc as written
    • test success if no change happened, test fail if there was a diff

Seems good to me. Now do the TOC : D

// We need to handle a few special cases:
//
// * Dual-labeled and labeled metrics should be sorted right after their top-level metric type
// * Normalizing plurals to be sorted correctly after the singular (quantity -> quantitys)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// * Normalizing plurals to be sorted correctly after the singular (quantity -> quantitys)
// * Normalizing plurals to be sorted correctly after the singular (quantity -> quantities)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants