pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.4k stars 710 forks source link

`trailing-whitespace`: exclude `tsv` files by default. #1110

Closed randolf-scholz closed 2 weeks ago

randolf-scholz commented 2 weeks ago

Tab separated values is a common data-format similar to .csv, but by definition uses tabs as the separator.

Trailing tab stops naturally occur when missing values are present, because each row needs to contain the same number of tabs. Hence, the trailing-whitespace hook can corrupt .tsv files. I propose to add exclude_types: [tsv] to the default configuration of the hook.

asottile commented 2 weeks ago

you can alwaysexclude_types in your own config

it's more surprising to make this choice for everyone here