Skip to content

Add option for ignoring values#141

Merged
norwoodj merged 2 commits intonorwoodj:masterfrom
j-buczak:ignoring_values
Jun 29, 2022
Merged

Add option for ignoring values#141
norwoodj merged 2 commits intonorwoodj:masterfrom
j-buczak:ignoring_values

Conversation

@j-buczak
Copy link
Copy Markdown
Contributor

Ignoring is set up using # -- @ignored tag

Disclosure: this is my first code written in go - suggestions are more than welcome :)

Ignoring is set up using `# -- @ignored` tag
Replace `# -- @ignore` with simple `@ignore`
if !strings.Contains(node.HeadComment, "@ignore") {
removeIgnored(node, node.Kind)
newContent = append(newContent, node)
} else if parentKind == yaml.MappingNode {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your comment below, it seems this should be a separate if block and not part of the prior if?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reworded to:
if HeadComment contains @ignore don't include it in newContent. If root node is MappingNode don't include the next node as well

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! I see what you're saying...

@norwoodj norwoodj merged commit 935a760 into norwoodj:master Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants