paritytech / prdoc

prdoc files are YAML files following a defined schema and helping with code change documentation.
MIT License
11 stars 1 forks source link

sort pr numbers please #31

Closed gilescope closed 5 months ago

gilescope commented 6 months ago

prdoc run from root could sort the PR numbers before it checks them so it's easier to search for your one:

prdoc check                                                                                                                        2.DONT PANIC
PR #3754 -> ERR
PR #3696 -> ERR
PR #3438 -> OK 
PR #3616 -> OK 
PR #3471 -> ERR
PR #3190 -> ERR
PR #3749 -> ERR
chevdor commented 6 months ago

You don't need the full list if you search for a specific one. Sorting by PR number will not help find *your** PRs.

An easy and INefficient option to check a specific PR is prdoc check | grep 1234 but you can do better :)

prdoc check --help

Check one or more prdoc files for validity

Usage: prdoc check [OPTIONS]

Options:
  -f, --file <FILE>                    Directly specify the file to be checked. It can be relative to the base directory
  -c, --config <CONFIG>                [env: PRDOC_CONFIG=]
  -n, --number <NUMBER>                number
  -d, --prdoc-folders <PRDOC_FOLDERS>  [env: PRDOC_FOLDERS=]
  -l, --list <LIST>                    Get the list of PR numbers from a file
  -s, --schema <SCHEMA>                Schema to be used. Passing this flag/ENV overrides the value from the config [env: PRDOC_SCHEMA=]
  -j, --json                           Output as json
  -h, --help                           Print help

You should prefer:

prdoc check -n 1234
gilescope commented 6 months ago

Yeah, but if the program is going to list multiple PRs, it may as well do them sorted. And yes prdoc check | sort does work but it's just surprising it's not done automatically. Small tweak for a better UX should the user hold the tool in this particular way.