Enable checking git diffs for modifying "frozen" areas#146
Conversation
- Upgrade to Java 11 (tests: Java 17) - Add JGit as dependency - Add tinylog as logging framework
|
There is a "simpler" way with the keepac CLI tool. Explained at NiclasvanEyk/keepac#20 (comment). Even though, I very like the Java eco system, I am OK to use a go-based tool + jq to solve my issue. |
I was not aware of this tool. Lots of good ideas in there. |
|
Regarding the migration to Java11+, I need to do some research first. My problem is that most of the tools created in this organisation are support tools for a larger project that needs to run on Java8. Fortunately, I already have a workaround in mind, but I need to test it to make sure it works properly. |
Did you find some workaround? If not, maybe, "just" implementing a "toJson()" functionality (as |
# Conflicts: # CHANGELOG.md # heylogs-cli/src/main/java/nbbrd/heylogs/cli/CheckCommand.java
|
The CLI maybe needs more thought. Results in I have been in the rabbit whole of Picoli for that. |
Works, so maybe, leave as is ^^ (I could not come up with a better word for |
|
I could not manage to have errors properly output. Maybe you have an idea? |
# Conflicts: # CHANGELOG.md # heylogs-api/src/main/java/nbbrd/heylogs/Version.java
|
I'm still thinking about this gitdiff feature. Anyway, I have a few solutions:
|
|
The latest merge of development branch broke this functionality. Too much effort to maintain. Exporting to JSON is the better way! |
|
I finally made the switch to clparse (for this use case) at JabRef/jabref#10641. So, no need to think through this use-case further. (just for information: clparse needed to be changed to support "my" CHANGELOG files ^^ -- marcaddeo/clparse#22) |
The
checkfeature now contains a check if during an update of the CHANGELOG.md file, areas of released versions are touched.For instance, a contributor starts a pull request and adds their change to CHANGELOG.md.
Then, the main branch is released.
Now, the PR should move the changelog entry to the new
[unreleased]section.Therefore,
heylogswarns in case there are modifications inside blocks of released versions.One has to enable this check explicitly by the
-gcommand line parameter.I had to include JGit as dependency. Therefore, the minimum Java requirement is Java 11. I think, this is OK, because Java 17 should be available at most systems.
I use the multiline string feature in the tests, therefore, the tests are Java 17.
Since I wanted to output some debug information, I added
tinylogas logging framework. The main reason is thatLogger.debugcan be used without any instantiation. - The logging traffic of JGit is routed to tinylog.Example output:
Due to the way of visiting the Markdown tree, errors in the last block come as very last. I can fix this in a follow-up work, because I think, this issue occurs very seldom - and is just a "UX" issue.