git » chasquid » commit 953d380

make: Auto-format Python files, and update existing

author Alberto Bertogli
2026-04-06 18:31:58 UTC
committer Alberto Bertogli
2026-04-06 18:31:58 UTC
parent e78d5043e37f1f45a3191324122b65fb08b5c212

make: Auto-format Python files, and update existing

This patch adds extends `make fmt` to auto-format Python files using
`black`, and also runs it on the existing files.

Makefile +5 -0
internal/queue/queue.proto +3 -3
internal/tlsconst/generate-ciphers.py +2 -4
internal/userdb/userdb.proto +1 -1

diff --git a/Makefile b/Makefile
index 67f45b4..87c1c92 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,11 @@ fmt:
 	go vet ./...
 	gofmt -s -w .
 	clang-format -i $(shell find . -iname '*.proto')
+	black -l 79 \
+		test/util/check-hostaliases \
+		test/util/chamuyero \
+		test/util/mail_diff \
+		internal/tlsconst/generate-ciphers.py
 
 .PHONY: chasquid test \
 	chasquid-util smtp-check mda-lmtp dovecot-auth-cli \
diff --git a/internal/queue/queue.proto b/internal/queue/queue.proto
index 073edca..6e15226 100644
--- a/internal/queue/queue.proto
+++ b/internal/queue/queue.proto
@@ -27,7 +27,7 @@ message Recipient {
 	enum Type {
 		EMAIL = 0;
 		PIPE = 1;
-                FORWARD = 2;
+		FORWARD = 2;
 	}
 	Type type = 2;
 
@@ -45,8 +45,8 @@ message Recipient {
 	// cases.
 	string original_address = 5;
 
-        // The list of servers to use, for recipients of type == FORWARD.
-        repeated string via = 6;
+	// The list of servers to use, for recipients of type == FORWARD.
+	repeated string via = 6;
 }
 
 // Timestamp representation, for convenience.
diff --git a/internal/tlsconst/generate-ciphers.py b/internal/tlsconst/generate-ciphers.py
index f614f83..6cd873c 100755
--- a/internal/tlsconst/generate-ciphers.py
+++ b/internal/tlsconst/generate-ciphers.py
@@ -38,8 +38,7 @@ def getCiphers():
 ciphers = getCiphers()
 
 out = open(sys.argv[1], "w")
-out.write(
-    """\
+out.write("""\
 package tlsconst
 
 // AUTOGENERATED - DO NOT EDIT
@@ -47,8 +46,7 @@ package tlsconst
 // This file was autogenerated by generate-ciphers.py.
 
 var cipherSuiteName = map[uint16]string{
-"""
-)
+""")
 
 for ver, desc in ciphers:
     out.write('\t%s: "%s",\n' % (ver, desc))
diff --git a/internal/userdb/userdb.proto b/internal/userdb/userdb.proto
index e23f24a..9d6cf44 100644
--- a/internal/userdb/userdb.proto
+++ b/internal/userdb/userdb.proto
@@ -29,4 +29,4 @@ message Plain {
 	bytes password = 1;
 }
 
-message Denied { }
+message Denied {}