Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Add warning comments to all YAML-modifying regular expressions #1020

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

samb1729
Copy link
Contributor

This should be sufficient to ensure that anyone considering modifying these bits
of code understands it's probably not a good idea.

See #1019

This should be sufficient to ensure that anyone considering modifying these bits
of code understands it's probably not a good idea.
@samb1729 samb1729 requested a review from squaremo March 22, 2018 15:03
// Replacing labels: these are in two places, the container template and the selector
// TODO: This doesn't handle # comments
// TODO: This encodes an expectation of map keys being ordered (i.e. name *then* version)
// TODO: This assumes that these are indented by exactly 2 spaces (which may not be true)
replaceLabelsRE := multilineRE(
`((?: selector| labels):.*)`,
`((?: ){2,4}name:.*)`,
`((?: ){2,4}version:\s*) (?:` + optq + `[-\w]+` + optq + `)(\s.*)`,
`((?: ){2,4}version:\s*) (?:`+optq+`[-\w]+`+optq+`)(\s.*)`,

This comment was marked as abuse.

This comment was marked as abuse.

@samb1729 samb1729 merged commit 0e970a1 into master Mar 22, 2018
@samb1729 samb1729 deleted the add-regex-warning branch March 22, 2018 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants