mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
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> |
||
|---|---|---|
| .. | ||
| commands | ||
| languages | ||
| meta_hooks | ||
| resources | ||
| __init__.py | ||
| __main__.py | ||
| all_languages.py | ||
| clientlib.py | ||
| color.py | ||
| constants.py | ||
| envcontext.py | ||
| error_handler.py | ||
| errors.py | ||
| file_lock.py | ||
| git.py | ||
| hook.py | ||
| lang_base.py | ||
| logging_handler.py | ||
| main.py | ||
| output.py | ||
| parse_shebang.py | ||
| prefix.py | ||
| repository.py | ||
| staged_files_only.py | ||
| store.py | ||
| util.py | ||
| xargs.py | ||
| yaml.py | ||
| yaml_rewrite.py | ||