From ad9b77870135d1a1db0cf51aa4b850b86cbaedf3 Mon Sep 17 00:00:00 2001 From: Matt Dale <9760375+matthewdale@users.noreply.github.com> Date: Mon, 10 Apr 2023 12:18:23 -0700 Subject: [PATCH] Ignore testable example 'Output' comments in line-length linter. (#1224) --- etc/check_fmt.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/check_fmt.sh b/etc/check_fmt.sh index 9b7f77dfa6..503c166f4c 100755 --- a/etc/check_fmt.sh +++ b/etc/check_fmt.sh @@ -12,11 +12,13 @@ fi # Use the "github.com/walle/lll" tool to check that all lines in *_example_test.go files are # wrapped at 80 characters to keep them readable when rendered on https://pkg.go.dev. -# Ignore long lines that are comments containing URI-like strings. +# Ignore long lines that are comments containing URI-like strings and testable example output +# comments like "// Output: ...". # E.g ignored lines: # // "mongodb://ldap-user:ldap-pwd@localhost:27017/?authMechanism=PLAIN" # // (https://www.mongodb.com/docs/manual/core/authentication-mechanisms-enterprise/#security-auth-ldap). -lll_out="$(find . -type f -name "*_examples_test.go" | lll -w 4 -l 80 -e '^\s*\/\/.+:\/\/' --files)" +# // Output: {"myint": {"$numberLong":"1"},"int32": {"$numberLong":"1"},"int64": {"$numberLong":"1"}} +lll_out="$(find . -type f -name "*_examples_test.go" | lll -w 4 -l 80 -e '^\s*\/\/(.+:\/\/| Output:)' --files)" if [[ $lll_out ]]; then echo "lll check failed for:";