◐ Shell
clean mode source ↗

Extend check for illegal Windows filenames by Jeffrey-Lim · Pull Request #1049 · pre-commit/pre-commit-hooks

Fixes #1048. It took some time to get it right, but I'm pretty sure this covers every possible illegal file name now.

For reference, the following names are illegal on Windows:

  • A name with any of the characters < > : " \ | ? * or any characters in the ASCII range 0-31
  • CON, PRN, AUX, NUL, COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM¹, COM², COM³, LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, LPT¹, LPT², and LPT³
  • A name ending with a space or period