Skip to content

Commit

Permalink
Auto-format protobuf files
Browse files Browse the repository at this point in the history
This patch runs clang-format on the protobuf files, and also adds a
Makefile target for auto-formatting code (Go and protobuf) for
convenience.
  • Loading branch information
albertito committed Oct 3, 2023
1 parent d570372 commit 8ded1f6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Language: Proto
BasedOnStyle: Google
IndentWidth: 8
UseTab: AlignWithSpaces
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Exceptions to the rules above: files we care about that would otherwise be
# excluded.
!.gitignore
!.clang-format
!.github/

# The binaries.
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ install-config-skeleton:
chown -v mail:mail /var/lib/chasquid ; \
fi

fmt:
go vet ./...
gofmt -s -w .
clang-format -i $(shell find . -iname '*.proto')

.PHONY: chasquid test \
chasquid-util smtp-check mda-lmtp dovecot-auth-cli
chasquid-util smtp-check mda-lmtp dovecot-auth-cli \
fmt
9 changes: 5 additions & 4 deletions internal/config/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ message Config {

// Addresses to listen on for submission-over-TLS (usually port 465).
// Default: "systemd", which means systemd passes sockets to us.
// systemd sockets must be named with "FileDescriptorName=submission_tls".
// systemd sockets must be named with
// "FileDescriptorName=submission_tls".
repeated string submission_over_tls_address = 5;

// Address for the monitoring http server.
Expand All @@ -37,9 +38,9 @@ message Config {
string monitoring_address = 6;

// Mail delivery agent (MDA, also known as LDA) to use.
// This should point to the binary to use to deliver email to local users.
// The content of the email will be passed via stdin.
// If it exits unsuccessfully, we assume the mail was not delivered.
// This should point to the binary to use to deliver email to local
// users. The content of the email will be passed via stdin. If it exits
// unsuccessfully, we assume the mail was not delivered.
// Default: "maildrop".
string mail_delivery_agent_bin = 7;

Expand Down
9 changes: 4 additions & 5 deletions internal/queue/queue.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ message Recipient {
// We used to use the well-known type, but the dependency makes packaging much
// more convoluted and adds very little value, so we now just include it here.
message Timestamp {
// Represents seconds of UTC time since Unix epoch.
int64 seconds = 1;
// Represents seconds of UTC time since Unix epoch.
int64 seconds = 1;

// Non-negative fractions of a second at nanosecond resolution.
int32 nanos = 2;
// Non-negative fractions of a second at nanosecond resolution.
int32 nanos = 2;
}

0 comments on commit 8ded1f6

Please sign in to comment.