-
Notifications
You must be signed in to change notification settings - Fork 56
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
The GitHub action for Darker doesn't use syntax highlighting #263
Comments
Thanks @mayk0gan, I will consider that and return to this suggestion a bit later. |
@mayk0gan, as far as I understand, the solution for subprocess.call output in color on Stack Overflow captures all output and prints it all in one color. I would assume you'd prefer to have Darker's original output colors intact in the GitHub Action output instead? Do you have an idea of how to achieve that? Jeff Geerling's blog post Getting colorized output from Molecule and Ansible on GitHub Actions for CI suggests to me that GitHub Actions actually will convert TTY ANSI color codes to HTML colors, and the problem here is only that Darker assumes the output is not to a TTY and will thus disable colors. So maybe a command line option or environment variable to force color output would suffice?
On the other hand, Jeff writes:
The two places in Darker code which decide between color and raw output are |
@mayk0gan I can include Darker color output in the GitHub Action in release 1.5.0 if you think that would make sense and if you can lend your hand a bit by testing and discussing the design choices mentioned above. |
Currently, you run:
proc = subprocess.run([sys.executable, str(MAIN_SCRIPT)]);
in the github action.
It doesn't output any colors, which makes it harder to understand darker's output.
You could use something like written here: https://stackoverflow.com/questions/58307157/subprocess-call-output-in-color printing the output with colors.
The text was updated successfully, but these errors were encountered: