chore(script): generate changelog from structure#12516
Conversation
shonfeder
left a comment
There was a problem hiding this comment.
I have a few suggestions here, but none blocking in case you don't like them :)
| list_of_files=$(find "$dir" -maxdepth 1 -type f -not -name ".*") | ||
| number_of_files=$(cat $list_of_files | wc -l) |
There was a problem hiding this comment.
If it finds nothing I think the result here will just be the empty string, in which case there is no need to count the lines, but can instead compare for equality with "".
| exit 1 | ||
| fi | ||
|
|
||
| list_of_files=$(find "$dir" -maxdepth 1 -type f -not -name ".*") |
There was a problem hiding this comment.
Could this just be
| list_of_files=$(find "$dir" -maxdepth 1 -type f -not -name ".*") | |
| list_of_files=$(cat "$dir/*.md") |
This is arguably more precise, in that if new files types are ever added for some reason they won't be scoped up, and simpler to read, I think.
fd57aae to
bb573a9
Compare
|
Thanks, @shonfeder, for the feedback! I went for a hybrid solution. The problem with the |
Signed-off-by: Etienne Marais <self@maiste.fr>
Signed-off-by: Etienne Marais <self@maiste.fr>
Signed-off-by: Etienne Marais <self@maiste.fr>
bb573a9 to
2a57a8f
Compare
* 'main' of github.com:/ocaml/dune: (147 commits) cram test: test only parameter flags in merlin generation fix(oxcaml): import eta-expansion changes from opam-repo (ocaml#12563) address review comments Mask the path to the stdlib fix(oxcaml): generate merlin config for library parameters fix(melange + include_qualified): track correct `.cmj` dependencies in emit (ocaml#12531) refactor: remove some unused code in [Path] (ocaml#12558) dep_rules: don't run (transitive) `ocamldep` on single module buildables (ocaml#12555) fix(pkg): ignore project settings for building packages test(pkg): reproduce ocaml#12131 melange: add a test for module cycle checks (ocaml#12554) chore: lint check for new changes entries (ocaml#12553) feature(cram): allow for conflict detection (ocaml#12538) ci: update for ocaml 5.4 release (ocaml#12552) chore(script): generate changelog from structure (ocaml#12516) Reuse dependencies between project and tools (ocaml#12526) Introduce Io.overwrite_file test: fix dune install requiring a mandir Enable package management for more tests Add a `dune tools env` command to add dev tools to PATH (ocaml#12521) ...
This PR is the second part of #12304. It allows us to generate the changelog from the structure in
changes/.It starts by generating the header. Then, the script stacks all the files from the various directories inside the new changelog file. While it is adding the files, it also removes them (we have git, it is easy to revert it). After that, it adds the old changelog without the unnecessary header. Finally, it moves the new changelog to replace the old one.
Requires #12472
Fixes #12304.