Initial commit

This commit is contained in:
Smaug123
2023-09-06 18:28:06 +01:00
commit ecd168d284
33 changed files with 2521 additions and 0 deletions

25
hooks/pre-push Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python3
import subprocess
def check_fantomas():
result = subprocess.run(["dotnet", "tool", "run", "fantomas", "--check", "."])
if result.returncode != 0:
print(result.stdout)
raise Exception(f"Formatting incomplete (return code: {result.returncode}). Consider running `dotnet tool run fantomas .`")
def check_alejandra():
result = subprocess.run(["alejandra", "--check", "--quiet", "*.nix"])
if result.returncode != 0:
print(result.stdout)
raise Exception(f"Formatting incomplete (return code: {result.returncode}). Consider running `alejandra *.nix`")
def main():
check_fantomas()
check_alejandra()
if __name__ == "__main__":
main()