Skip to content

Commit

Permalink
vet: add check to ensure terminating newline (grpc#7645)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshitachandwani authored Oct 7, 2024
1 parent 5fd9853 commit e8a70c6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Documentation/grpc-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@ available [here](../examples/features/metadata_interceptor/server/main.go).
[Header]: https://godoc.org/google.golang.org/grpc#Header
[Trailer]: https://godoc.org/google.golang.org/grpc#Trailer
[CallOption]: https://godoc.org/google.golang.org/grpc#CallOption
[metadata]: https://godoc.org/google.golang.org/grpc/metadata
[metadata]: https://godoc.org/google.golang.org/grpc/metadata
2 changes: 1 addition & 1 deletion examples/data/rbac/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
}
],
"deny_rules": []
}
}
2 changes: 1 addition & 1 deletion examples/features/name_resolving/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ proper name resolver, this would fail. In the example it picks the `example`
resolver that we installed. The `example` resolver can handle
`resolver.example.grpc.io` correctly by returning the backend address. So even
though the backend IP is not set when ClientConn is created, the connection will
be created to the correct backend.
be created to the correct backend.
2 changes: 1 addition & 1 deletion reflection/test/grpc_testing_not_regenerate/dynamic.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ message DynamicReq {}
service DynamicService {
// DynamicMessage1 is a test RPC for dynamically constructed protobufs.
rpc DynamicMessage1(DynamicReq) returns (DynamicRes);
}
}
3 changes: 3 additions & 0 deletions scripts/vet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ not git grep "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" --
# - Ensure that no trailing spaces are found.
not git grep '[[:blank:]]$'

# - Ensure that all files have a terminating newline.
git ls-files | not xargs -I {} sh -c '[ -n "$(tail -c 1 "{}" 2>/dev/null)" ] && echo "{}: No terminating new line found"' | fail_on_output

# - Ensure that no tabs are found in markdown files.
not git grep $'\t' -- '*.md'

Expand Down
2 changes: 1 addition & 1 deletion testdata/x509/client_with_spiffe_openssl.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ extendedKeyUsage = critical,clientAuth
subjectAltName = @alt_names

[alt_names]
URI = spiffe://foo.bar.com/client/workload/1
URI = spiffe://foo.bar.com/client/workload/1

0 comments on commit e8a70c6

Please sign in to comment.