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

Add --no-color support / ability to disable ANSI escape codes to argo lint command #12913

Closed
menzenski opened this issue Apr 8, 2024 · 4 comments · Fixed by #12953
Closed
Labels
area/cli The `argo` CLI good first issue Good for newcomers solution/suggested A solution to the bug has been suggested. Someone needs to implement it. solution/workaround There's a workaround, might not be great, but exists type/feature Feature request
Milestone

Comments

@menzenski
Copy link
Contributor

Summary

What change needs making?

I am trying to run argo lint with color disabled. I see that some CLI commands support a --no-color option, but argo lint does not.

Other Argo CLI commands seem not to support this flag.

Use Cases

When would you use this?

For me, the use case is running argo lint --offline in CI (GitHub Actions). I want to run the command, capture the output, and include it in a GitHub comment on a Pull Request. The ANSI escape codes make the output hard to read:

�[4mdev/my_workflow.yaml�[0m:
   �[31m✖�[0m in "my-workflow" (CronWorkflow): cannot validate Workflow: spec.arguments.file-name-suffix.value or spec.arguments.file-name-suffix.valueFrom is required

�[31m✖ 3 linting errors found!�[0m

Message from the maintainers:

Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.

@menzenski menzenski added the type/feature Feature request label Apr 8, 2024
@shuangkun shuangkun added the area/cli The `argo` CLI label Apr 8, 2024
@blkperl blkperl added the good first issue Good for newcomers label Apr 10, 2024
@agilgur5
Copy link
Member

Does argo lint -o simple not suffice? The simple formatter should print without colors.

Otherwise, you'd need to add a --no-color flag to lint.go and pass that through to the pretty formatter, where you can use color.Toggle(false) to disable colors

@agilgur5 agilgur5 added solution/workaround There's a workaround, might not be great, but exists solution/suggested A solution to the bug has been suggested. Someone needs to implement it. labels Apr 17, 2024
@menzenski
Copy link
Contributor Author

Does argo lint -o simple not suffice? The simple formatter should print without colors.

Yeah, sorry - I should have said in the original post that we are using -o simple. It works fine but the spacing of the "non-simple" output is easier to read when there are multiple issues.

Admittedly this is a small quality-of-life thing.

@agilgur5
Copy link
Member

Admittedly this is a small quality-of-life thing.

If you're interested in contributing, we have labeled it as a "good first issue" 😉

@miltalex
Copy link
Member

@agilgur5 I could have a look if it is still up for grabs.

miltalex added a commit to miltalex/argo-workflows that referenced this issue Apr 19, 2024
miltalex added a commit to miltalex/argo-workflows that referenced this issue Apr 19, 2024
miltalex added a commit to miltalex/argo-workflows that referenced this issue Apr 19, 2024
@agilgur5 agilgur5 added this to the v3.6.0 milestone Apr 19, 2024
miltalex added a commit to miltalex/argo-workflows that referenced this issue Apr 19, 2024
miltalex added a commit to miltalex/argo-workflows that referenced this issue Apr 19, 2024
miltalex added a commit to miltalex/argo-workflows that referenced this issue Apr 19, 2024
agilgur5 pushed a commit that referenced this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI good first issue Good for newcomers solution/suggested A solution to the bug has been suggested. Someone needs to implement it. solution/workaround There's a workaround, might not be great, but exists type/feature Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants