feat: implement no_color mode#14119
Conversation
Hey @vitinh0z!Thank you for contributing to JabRef! Your help is truly appreciated ❤️. We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful. Please re-check our contribution guide in case of any other doubts related to our contribution workflow. |
koppor
left a comment
There was a problem hiding this comment.
Good first shot. A PR should modify as least places as possible. Why the changes var to val? Why the reformattings of the output part? Why the two more empty lines? I think, all of that can be undone?
|
I changed var to val because Gradle expects tasks to be immutable, which avoids caching and instrumentation issues (and is a good practice). Making this change helped me get the project working in the terminal (I spent a week troubleshooting the build). But I can revert the change. About the empty spaces, I can revert them. |
|
@vitinh0z You can to the changes from var to val in a follow up/separate PR |
- Move textFormatter version to version catalog - Reformat JABREF_BANNER concatenation change val to var
|
Is that right? |
Yes |
|
a failing test. if youc clilck on it you see the details. probably some temporary issue |
|
i think that is done |
|
you don't have to always merge main, as long as github shows no conflict you can leave it. This otherwise creates too much noise as we always get a notificaiton |
|
Ok ok |
|
I experimented a bit with it, removed some unnecessary lines, moved the textformatter entierly to BuildInfo to reduce deps. Tested it, works. Should be good to go now. |
* feat: implement no_color mode * fix format * apply OpenRewrite changes for String.format * Refactor: Apply suggestions from code review - Move textFormatter version to version catalog - Reformat JABREF_BANNER concatenation change val to var * fix format * fix format * fix format * fix (again) format * Nitpicks and removed unnecessary changes * Remove more unnecessary changes * Undo gradle-wrapper.properties again * Remove transitive, removed unnecessary deps * Removed more unnecessary changes * Reintroduce deps after testing --------- Co-authored-by: Carl Christian Snethlage <calixtus@users.noreply.github.com>


Closes #14086 - Support NO_COLOR environment variable
This PR implements the functionality for issue #14089 (support for the
NO_COLORstandard).The main code change was refactoring the
JABREF_BANNERconstant (inBuildInfo.java) to use theterminal-text-formatterlibrary, which automatically handles theNO_COLORenvironment variable. This also required correcting the 4 usage points (injabguiandjabkit) to use the.concat()method.The fixes I implemented (which are included in this PR) are:
jablib/build.gradle.kts: Changed theterminal-text-formatterdependency fromimplementationtoapi.jablib/module-info.java: Addedrequires transitive textFormatter;to expose the module.jabkit/module-info.java: Addedrequires textFormatter;.build-logic/.../dependency-rules.gradle.kts: AddedpatchRealModule("io.github.darvil82.utils", "utils")to fix a module patching error related to the new dependency.Steps to test
.\gradlew.bat :jabkit:run.NO_COLORenvironment variable:$env:NO_COLOR="true"(for PowerShell)..\gradlew.bat :jabkit:runagain.Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)with NO_COLOR
Default