Keep comments in toml file
See original GitHub issueEnvironment:
nl.littlerobots.version-catalog-update: 0.2.1 com.github.ben-manes.versions: 0.41.0 Gradle: 7.3.2
libs.versions.toml:
[versions]
# An important explanation of choosing this version
externalDependency = "1.0-fix"
Scenario:
./gradlew versionCatalogUpdate --no-configuration-cache
Result:
libs.versions.toml:
[versions]
externalDependency = "<the latest version here>"
Expected behavior:
The plugin can’t know about semantics but shouldn’t erase it from the config. Here is the source of truth for versions. This is why we keep knowledge about versions here.
libs.versions.toml:
[versions]
# An important explanation of choosing this version
externalDependency = "<the latest version here>"
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Comment blocks in config.toml - support
Is there a way to comment out sections of a config.toml file? The config.toml file I am working with uses a # symbol...
Read more >Comments support · Issue #77 · uiri/toml
I want to be able to load some toml with comments and add some key = value to this file and save with...
Read more >TOML: Tom's Obvious Minimal Language
TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously...
Read more >TOML File Format
TOML files mainly consist of key/value Pairs, sections/tables, comments and must be a valid UTF-8 encoded Unicode document. TOML supports String, Integer, ...
Read more >C++ toml11::preserve_comments
Description: After toml11 v3, we can choose whether comments in the toml file are to be preserved or not. toml::preserve_comments is used in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a pity. It seems a blocker for us because we have loads of comments as described in expected behavior. I’d like to use it in automation with minimal human interaction.
As I understand, this might add some clarifications https://github.com/toml-lang/toml/issues/836 for the problem. Preserving comments looks technically possible but needs to be done in a parser.
Thanks for that, I’ve checked out a few and they are either not compliant with the current toml spec and fail on parsing the syntax Gradle is using, or they skip comments. I did a quick check on ktoml and it seems that they also skip comments (and that project seems to be in an early state).
I’ll try the second pass route first, it might not be that bad as I thought initially given the restricted syntax of the Gradle toml file.