Skip to content

Comment deleting in list elements. #22

@rusnino

Description

@rusnino

Hello!
It seems that in case deletion list element comments deleted placed after element, not preceding comments.
For example, original list:

alarm-severity-config:
  schema-version: 1.0.0
  alarm-severity:
    # <Software Failure>
    # An error has occurred within a software program that has caused incorrect results
  - index: 1
    severity: 4
    # <CPU Usage Threshold Crossed>
    # A Central Processing Unit has issued an unacceptable number of instructions to accomplish a task
  - index: 2
    severity: 4
    # <HDD Usage Threshold Crossed>
    # A storage device has very little or no space available to store additional data
  - index: 3
    severity: 4

Deleting first list element:

-> % yaml-tools delete alarm-severity-config alarm-severity 0 -i ./initial/alarm_severity.yaml -o ./final/alarm_severity.yaml

Result:

alarm-severity-config:
  schema-version: 1.0.0
  alarm-severity:
    # <Software Failure>
    # An error has occurred within a software program that has caused incorrect results
  - index: 2
    severity: 4
    # <HDD Usage Threshold Crossed>
    # A storage device has very little or no space available to store additional data
  - index: 3
    severity: 4

Actually it`s will be helpful if user can choose which side (preceding or subsequent) will be deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions