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

Reformats the GH Actions workflow file, not just the "uses" lines #67

Closed
morganestes opened this issue Jan 8, 2024 · 2 comments · Fixed by #139
Closed

Reformats the GH Actions workflow file, not just the "uses" lines #67

morganestes opened this issue Jan 8, 2024 · 2 comments · Fixed by #139
Assignees
Labels
bug Something isn't working

Comments

@morganestes
Copy link

Describe the issue

When running the ghactions command, frizbee reformatted my YAML file in ways I didn't ask to or want. The docs say that it only touches the "uses" lines, but that's not the case.

The biggest issues are reformatting some (not all) inline shell scripts (removes all line breaks and makes the whole script a single line), rewriting emoji into Unicode strings, removing empty lines that I have in there for clarity, and removing spaces inside brackets. Basically, it forces its own coding style on my work without warning or any obvious way to prevent it.

To Reproduce

  • In a repo, with line spaces between workflow steps and/or spaces inside brackets, run GITHUB_TOKEN=$(gh auth token) frizbee ghactions.
  • Run git diff and observe the reformatting of workflow files.

What version are you using?

0.0.12

@morganestes morganestes added the bug Something isn't working label Jan 8, 2024
@JAORMX
Copy link
Contributor

JAORMX commented Jan 10, 2024

Thanks a lot for taking the time to submit this! I agree that it's unfortunate that it changes whitespaces within the file and it would be great if we would get that sorted.

For context, this is an issue with the fact we're using gopkg.in/yaml.v3. Apparently, other tools have had similar issues [1].

I'm open for suggestions on how to solve this, as I do think these whitespace changes are not a great user experience.

Thanks again for submitting this issue and checking frizbee out!

[1] kubernetes-sigs/kustomize#3946

@jhrozek
Copy link
Contributor

jhrozek commented Jan 11, 2024

even if hacky, I wonder if a better user experience would be to just gather the uses: substitutions and just substitute line for line without reassembling the YAML, since the uses lines are really just 1 line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants