A framework for managing and maintaining multi-language pre-commit hooks.
Find a file
Claude c064dd83df
Cap hook output at terminal width to prevent wrapping
Previously, _compute_cols() would calculate the ideal column width based
on hook names and message lengths, with a minimum of 80 columns. However,
it didn't consider the actual terminal width, causing the "Passed/Failed"
status to wrap to the next line on narrower terminals.

This change:
- Adds terminal width detection using shutil.get_terminal_size()
- Caps the column width at the terminal width to prevent wrapping
- Maintains the minimum of 80 columns when terminal is wide enough
- Falls back to 80 columns if terminal size cannot be determined

The algorithm now ensures output always fits within the terminal width,
similar to how pytest handles its output formatting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Kamil Monicz <kamil@monicz.dev>
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 13:28:22 +00:00
.github py310+ 2025-10-09 17:44:05 -04:00
pre_commit Cap hook output at terminal width to prevent wrapping 2025-10-28 13:28:22 +00:00
testing upgrade rbenv / ruby-build 2025-10-24 15:18:07 -04:00
tests Cap hook output at terminal width to prevent wrapping 2025-10-28 13:28:22 +00:00
.gitignore remove unneeded gitignore lines 2022-03-13 19:55:30 -04:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate 2025-10-13 20:38:45 +00:00
.pre-commit-hooks.yaml deprecate pre-commit-validate-{config,manifest} 2022-04-24 19:08:47 -04:00
CHANGELOG.md v4.3.0 2025-08-09 14:54:49 -04:00
CONTRIBUTING.md fix typo in CONTRIBUTING.md 2023-08-14 11:00:17 +01:00
LICENSE MIT 2014-06-05 08:57:40 -07:00
README.md azure pipelines -> github actions 2022-12-29 22:18:31 -05:00
requirements-dev.txt always use #!/bin/sh on windows 2022-01-05 13:22:49 -05:00
setup.cfg fix deprecated call 2025-10-16 10:23:30 -04:00
setup.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
tox.ini show 20 slowest durations in CI 2023-03-09 11:00:31 -05:00

build status pre-commit.ci status

pre-commit

A framework for managing and maintaining multi-language pre-commit hooks.

For more information see: https://pre-commit.com/