question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keep comments in toml file

See original GitHub issue

Environment:

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:closed
  • Created 2 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
eugene-krivobokovcommented, Jan 30, 2022

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.

2reactions
hvissercommented, Feb 3, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found