-
Notifications
You must be signed in to change notification settings - Fork 452
chore(script): generate changelog from structure #12516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
bb573a9 to
2a57a8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks :)
* '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.