Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore: ytt being able to emit comments #638

Closed
wants to merge 2 commits into from

Conversation

pivotaljohn
Copy link
Contributor

This is a PR meant for exploration: what would be the consequences of ytt emitting comments?

Inspired by: https://hackmd.io/IqHKk9LgSkadtrhV0-qyjg

@@ -1,10 +1,10 @@
resources:
Copy link
Contributor

Choose a reason for hiding this comment

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

non-indented arrays is more or less a given with yaml formatting. would not be good to change that for our end users imho.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

non-indented arrays is more or less a given with yaml formatting

From what I've seen, there is no clear consensus on the indentation of sequences:


... would not be good to change that for our end users imho...

I'm not sure.

On the one hand, the output of an upgraded version would not be syntactically identical, but it would semantically; so it's arguable.
One path is to give the user the option: if you want to output comments, sequences are indented; otherwise no change.

On the other hand, folks might be diff'ing text to determine if there are changes.
I'm unsure how common this is.

I'm currently thinking that the added value that comments can bring would outweigh any inconvenience.

What informs your humble opinion, here? What do you see?

@pivotaljohn
Copy link
Contributor Author

May depend on go-yaml/yaml#749 getting addressed.

From #carvel

Yeah I think it is just that the first sperator gets removed as you can see from the example (line 2 of app.yml). I was hoping there was a way to allow this as yamllint we have checks if the --- is at the start (edited)

@pivotaljohn pivotaljohn force-pushed the play-emit-comments branch from b4bc0f5 to 76ccbd9 Compare May 13, 2022 20:57
@pivotaljohn pivotaljohn force-pushed the play-emit-comments branch 2 times, most recently from d6959a1 to 22731c1 Compare May 24, 2022 22:31
@pivotaljohn pivotaljohn force-pushed the play-emit-comments branch from 22731c1 to 760c7b1 Compare June 7, 2022 19:31
jtigger added 2 commits July 19, 2022 12:19
- yaml.v3 author refuses to support special indentation for sequences;
  adjust tests containing arrays to indent.
  (see also: go-yaml/yaml#661)
@pivotaljohn pivotaljohn self-assigned this Jul 26, 2022
@pivotaljohn pivotaljohn changed the title Explore ytt being able to emit comments Explore: ytt being able to emit comments Oct 17, 2022
@pivotaljohn
Copy link
Contributor Author

Keeping the branch, but closing this PR, for now.

@tvkit
Copy link

tvkit commented Dec 2, 2024

Allowing eslint directives would be nice:
# eslint yml/sort-keys: warn

@github-actions github-actions bot added the carvel triage This issue has not yet been triaged for relevance label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel triage This issue has not yet been triaged for relevance cla-not-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants