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

Don't render bold ANSI sequence when colors are disabled #515

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

adam12
Copy link
Contributor

@adam12 adam12 commented Jul 6, 2023

When providing the --no-colors or colors: false options to Lefthook, it will still render an ANSI
sequence for bold, causing noise in the terminal.

Before

Lefthook v1.4.1
RUNNING HOOK: ^[[1mpre-commit^[[0m
^[[1mstandardrb^[[0m: (skip) no matching staged files

SUMMARY: (SKIP EMPTY)

After

Lefthook v1.4.3
RUNNING HOOK: pre-commit
standardrb: (skip) no matching staged files

SUMMARY: (SKIP EMPTY)

⚡ Summary

Add a similar check for std.colors to the Bold function.

☑️ Checklist

  • Check locally
  • Add tests

@mrexox
Copy link
Member

mrexox commented Jul 10, 2023

Thank you!

@mrexox mrexox merged commit bb2eaa8 into evilmartians:master Jul 10, 2023
@adam12 adam12 deleted the no-colors-bold branch July 10, 2023 13:18
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.

2 participants