Skip to content

Commit

Permalink
Avoid dropping comments on YAML transformation (#3392)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored May 3, 2023
1 parent 24a90f8 commit b1f923b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .config/requirements-lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pygments==2.15.1
pyrsistent==0.19.3
pyyaml==6.0
rich==13.3.5
ruamel-yaml==0.17.21
ruamel-yaml==0.17.22
subprocess-tee==0.4.1
tomli==2.0.1
typing-extensions==4.5.0
Expand Down
2 changes: 1 addition & 1 deletion .config/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jsonschema>=4.10.0 # MIT, version needed for improved errors
packaging>=21.3 # Apache-2.0,BSD-2-Clause
pyyaml>=5.4.1 # MIT (centos 9 has 5.3.1)
rich>=12.0.0 # MIT
ruamel.yaml>=0.17.21,<0.18 # MIT, next version is planned to have breaking changes
ruamel.yaml>=0.17.22,<0.18 # MIT, next version is planned to have breaking changes
subprocess-tee>=0.4.1 # MIT, used by ansible-compat
yamllint >= 1.30.0 # GPLv3
wcmatch>=8.1.2 # MIT
2 changes: 1 addition & 1 deletion .config/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ rdflib==6.3.2
regex==2023.3.23
requests==2.28.2
rich==13.3.5
ruamel-yaml==0.17.21
ruamel-yaml==0.17.22
six==1.16.0
soupsieve==2.4
spdx-tools==0.7.1
Expand Down
6 changes: 3 additions & 3 deletions examples/playbooks/vars/strings.transformed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ double_multiline_with_octothorpe: "double over 160 char line to force wrapping.
# this is not a comment"

# this is a comment
folded_block_scalar_with_octothorpe: >
folded_block_scalar_with_octothorpe: > # comment 1
# this is not a comment
# this is a comment
folded_chomp_strip_block_scalar_with_octothorpe: >-
folded_chomp_strip_block_scalar_with_octothorpe: >- # comment 2
# this is not a comment
# this is a comment
folded_chomp_keep_block_scalar_with_octothorpe: >+
folded_chomp_keep_block_scalar_with_octothorpe: >+ # comment 3
# this is not a comment
# this is a comment
Expand Down
6 changes: 3 additions & 3 deletions examples/playbooks/vars/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ double_multiline_with_octothorpe: # this EOL comment gets lost
# this is not a comment"

# this is a comment
folded_block_scalar_with_octothorpe: > # > EOL comment gets lost
folded_block_scalar_with_octothorpe: > # comment 1
# this is not a comment
# this is a comment
folded_chomp_strip_block_scalar_with_octothorpe: >- # > EOL comment gets lost
folded_chomp_strip_block_scalar_with_octothorpe: >- # comment 2
# this is not a comment
# this is a comment
folded_chomp_keep_block_scalar_with_octothorpe: >+ # > EOL comment gets lost
folded_chomp_keep_block_scalar_with_octothorpe: >+ # comment 3
# this is not a comment
# this is a comment
Expand Down
6 changes: 3 additions & 3 deletions src/ansiblelint/schemas/__store__.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"ansible-lint-config": {
"etag": "ae3bdb0eed9825f89ad76dc5dc4d812ca08591558bbdde401ba68030d658c6f6",
"etag": "0c180fc60da7bfbbf70d0ffa6dd4871aefce5e6f987f9c8073cb203dacd991b2",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json"
},
"ansible-navigator-config": {
"etag": "22dcf91587ac30f126a20907a9a036e56860bbe36dc6b18fc15a7fbad0312c73",
"etag": "59cfdb89d07c929dbd8a0127fbc824faffdb0a094052d36935266770fcbd4bca",
"url": "https://raw.githubusercontent.com/ansible/ansible-navigator/main/src/ansible_navigator/data/ansible-navigator.json"
},
"changelog": {
"etag": "9d65bd02c484c8fdfb98527401b49ff74d05edc8092abfb2767a2d06a7eb2063",
"etag": "593ed5eef7c1e670f3667de70d43a41a5138513bd9640a85cbe8cb6faaa59793",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/changelog.json"
},
"execution-environment": {
Expand Down
4 changes: 2 additions & 2 deletions src/ansiblelint/schemas/ansible-navigator-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@
"required": [
"ansible-navigator"
],
"title": "ansible-navigator settings v3.1",
"title": "ansible-navigator settings v3.2",
"type": "object",
"version": "3.1"
"version": "3.2"
}
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ commands =
description = Rebuild and test JSON Schemas
deps =
check-jsonschema
setenv =
# without his upgrade would likely not do anything
PIP_CONSTRAINT = /dev/null
skip_install = true
changedir = test/schemas
commands_pre =
Expand Down

0 comments on commit b1f923b

Please sign in to comment.