Compute the number of columns to display hook messages. The widest that will be displayed is in the no files skipped case: Hook name...(no files to check) Skipped
(hooks: Sequence[Hook])
| 236 | |
| 237 | |
| 238 | def _compute_cols(hooks: Sequence[Hook]) -> int: |
| 239 | """Compute the number of columns to display hook messages. The widest |
| 240 | that will be displayed is in the no files skipped case: |
| 241 | |
| 242 | Hook name...(no files to check) Skipped |
| 243 | """ |
| 244 | if hooks: |
| 245 | name_len = max(_len_cjk(hook.name) for hook in hooks) |
| 246 | else: |
| 247 | name_len = 0 |
| 248 | |
| 249 | cols = name_len + 3 + len(NO_FILES) + 1 + len(SKIPPED) |
| 250 | return max(cols, 80) |
| 251 | |
| 252 | |
| 253 | def _all_filenames(args: argparse.Namespace) -> Iterable[str]: |