From 0bf192aae0789c9ca8f974fe84637e541093433c Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Thu, 3 Dec 2020 18:06:42 +1100 Subject: [PATCH] [CI] Adjust reviewdog filtermode for linting (#1506) This will ensure that linter errors are picked up for the entire codebase instead of just against the default of [added/modified lines](https://github.com/reviewdog/reviewdog#added-default). --- .buildkite/pipeline.sh | 2 +- .../validator/authentication_test.go | 16 ++++++++-------- internal/configuration/validator/const.go | 6 +++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index e9f51866..f7f48533 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -27,7 +27,7 @@ env: steps: - label: ":service_dog: Linting" - command: "reviewdog -reporter=github-check -fail-on-error" + command: "reviewdog -reporter=github-check -filter-mode=nofilter -fail-on-error" retry: automatic: true if: build.branch !~ /^(v[0-9]+\.[0-9]+\.[0-9]+)$\$/ diff --git a/internal/configuration/validator/authentication_test.go b/internal/configuration/validator/authentication_test.go index fcb9aad6..7da18d0d 100644 --- a/internal/configuration/validator/authentication_test.go +++ b/internal/configuration/validator/authentication_test.go @@ -160,10 +160,10 @@ func (suite *LdapAuthenticationBackendSuite) SetupTest() { suite.configuration = schema.AuthenticationBackendConfiguration{} suite.configuration.Ldap = &schema.LDAPAuthenticationBackendConfiguration{} suite.configuration.Ldap.Implementation = schema.LDAPImplementationCustom - suite.configuration.Ldap.URL = "ldap://ldap" - suite.configuration.Ldap.User = "user" - suite.configuration.Ldap.Password = "password" - suite.configuration.Ldap.BaseDN = "base_dn" + suite.configuration.Ldap.URL = testLDAPURL + suite.configuration.Ldap.User = testLDAPUser + suite.configuration.Ldap.Password = testLDAPPassword + suite.configuration.Ldap.BaseDN = testLDAPBaseDN suite.configuration.Ldap.UsernameAttribute = "uid" suite.configuration.Ldap.UsersFilter = "({username_attribute}={input})" suite.configuration.Ldap.GroupsFilter = "(cn={input})" @@ -340,10 +340,10 @@ func (suite *ActiveDirectoryAuthenticationBackendSuite) SetupTest() { suite.configuration = schema.AuthenticationBackendConfiguration{} suite.configuration.Ldap = &schema.LDAPAuthenticationBackendConfiguration{} suite.configuration.Ldap.Implementation = schema.LDAPImplementationActiveDirectory - suite.configuration.Ldap.URL = "ldap://ldap" - suite.configuration.Ldap.User = "user" - suite.configuration.Ldap.Password = "password" - suite.configuration.Ldap.BaseDN = "base_dn" + suite.configuration.Ldap.URL = testLDAPURL + suite.configuration.Ldap.User = testLDAPUser + suite.configuration.Ldap.Password = testLDAPPassword + suite.configuration.Ldap.BaseDN = testLDAPBaseDN } func (suite *ActiveDirectoryAuthenticationBackendSuite) TestShouldSetActiveDirectoryDefaults() { diff --git a/internal/configuration/validator/const.go b/internal/configuration/validator/const.go index 5e7ee5d6..acbdea81 100644 --- a/internal/configuration/validator/const.go +++ b/internal/configuration/validator/const.go @@ -167,7 +167,11 @@ const schemeLDAP = "ldap" const schemeLDAPS = "ldaps" const testBadTimer = "-1" -const testModeDisabled = "disable" const testJWTSecret = "a_secret" +const testLDAPBaseDN = "base_dn" +const testLDAPPassword = "password" +const testLDAPURL = "ldap://ldap" +const testLDAPUser = "user" +const testModeDisabled = "disable" const testTLSCert = "/tmp/cert.pem" const testTLSKey = "/tmp/key.pem"