sg: Fix incorrect matching of comments in sg lint -fix go (#46202)

* sg: Fix incorrect matching of comments in `sg lint -fix go`

* Remove `CI:LOCALHOST_OK` introduced in #46151
This commit is contained in:
Sander Ginn 2023-01-06 14:28:58 +01:00 committed by GitHub
parent a8e86404c4
commit 373b795ee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ func maybePostgresProcFile() (string, error) {
// we configured above.
for prefix, database := range databases {
if !isPostgresConfigured(prefix) {
// Set *PGHOST to default to 127.0.0.1, NOT localhost, as localhost does not correctly resolve in some environments (CI:LOCALHOST_OK)
// Set *PGHOST to default to 127.0.0.1, NOT localhost, as localhost does not correctly resolve in some environments
// (see https://github.com/sourcegraph/issues/issues/34 and https://github.com/sourcegraph/sourcegraph/issues/9129).
SetDefaultEnv(prefix+"PGHOST", "127.0.0.1")
SetDefaultEnv(prefix+"PGUSER", "postgres")

View File

@ -12,7 +12,7 @@ path_filter() {
}
set +e
LOCALHOST_MATCHES=$(git grep -e localhost --and --not -e '^\s*//' --and --not -e 'CI\:LOCALHOST_OK' -- '*.go' \
LOCALHOST_MATCHES=$(git grep -e localhost --and -e '^(?!\s*//)' --and --not -e 'CI\:LOCALHOST_OK' -- '*.go' \
':(exclude)*_test.go' \
':(exclude)cmd/server/shared/nginx.go' \
':(exclude)dev/sg/sg_setup.go' \

View File

@ -131,7 +131,7 @@ func Send(ctx context.Context, source string, message Message) (err error) {
// NOTE: Some services (e.g. Google SMTP relay) require to echo desired hostname,
// our current email dependency "github.com/jordan-wright/email" has no option
// for it and always echoes "localhost" which makes it unusable. (CI:LOCALHOST_OK)
// for it and always echoes "localhost" which makes it unusable.
heloHostname := conf.EmailSmtp.Domain
if heloHostname == "" {
heloHostname = "localhost" // CI:LOCALHOST_OK