Preserve comments in policy_yaml
block
#2055
Labels
kind/improvement
Improvement on an existing feature
triage/accepted
The issue was reviewed and is complete enough to start working on it
Description
Now when we parse the yaml in
policy_yaml
it will remove the comments. One simple trick that we could do to preserve them would be to create a map like this:and after all the modifications are done reapply the comments by searching the map for the same line and a closeby
line_number
. E.g.:would create a map like:
and then we would reapply this comment somewhere near 20 line (let's say [15, 25]) to lines that match
match:
. WDYT?The text was updated successfully, but these errors were encountered: