bazel-deps
bazel-deps copied to clipboard
format-deps and add-dep commands strip out comments
This:
options:
# one comment
languages: [ "java" ]
licenses: [ "permissive" ]
resolvers:
- id: "mavencentral"
type: "default"
url: https://repo.maven.apache.org/maven2/
thirdPartyDirectory: "third_party/maven/"
transitivity: runtime_deps
versionConflictPolicy: highest
dependencies:
# another one
org.slf4j:
slf4j-simple:
lang: java
version: "1.7.25"
turns into this:
options:
languages: [ "java" ]
licenses: [ "permissive" ]
resolvers:
- id: "mavencentral"
type: "default"
url: https://repo.maven.apache.org/maven2/
thirdPartyDirectory: "third_party/maven/"
transitivity: runtime_deps
versionConflictPolicy: highest
dependencies:
org.slf4j:
slf4j-simple:
lang: java
version: "1.7.25"
Could you please either fix the behaviour or warn that comments were lost?
It’s hard to fix because the parser we are using strips the comments.
Related to #15
If you know a yaml parser that can address these two issues, let me know. Yaml is kind of a big spec so while it would be easy to parse our current subset it would not be easy to parse in general.
A work around could be to add explicit comment nodes at points. Kind of junky, but it would lift the comment to a logical level where the parse won’t lose it.