Created
November 11, 2025 23:38
-
-
Save Vizonex/a7f7b45b504fc2dd648d1ba2f373e73d to your computer and use it in GitHub Desktop.
Fixer for pre-commit under the circumstances that were on windows and pre-commit-yaml doesn't decide to play nicely with us.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Small mini fixer for pre-commit yaml to play nicely with windows since windows has it's own quirks unlike linux. | |
| # This repairs and fixes the probelm. | |
| import sys | |
| import pathlib | |
| if __name__ == "__main__": | |
| if ("--help" in sys.argv) or ("-h" in sys.argv): | |
| print(" fix_yaml.py <FILE>\n") | |
| print(" FILE A yaml file that needs fixing") | |
| print(" --help, -h Prints help and exits") | |
| else: | |
| path = pathlib.Path(sys.argv[1]) | |
| data = path.read_bytes().replace(b"\r\n", b"\n") | |
| path.write_bytes(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment