From 28866917d253211b77c06f5287cf228560af3c59 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Fri, 19 Jun 2020 14:35:55 -0700 Subject: [PATCH] remove use of the term 'blacklist' --- github/gen-accessors.go | 20 ++++++++++---------- github/gen-stringify-test.go | 20 ++++++++++---------- update-urls/main.go | 8 ++++---- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/github/gen-accessors.go b/github/gen-accessors.go index 4c5e8eec7e7..3a0243f1aba 100644 --- a/github/gen-accessors.go +++ b/github/gen-accessors.go @@ -37,8 +37,8 @@ var ( sourceTmpl = template.Must(template.New("source").Parse(source)) - // blacklistStructMethod lists "struct.method" combos to skip. - blacklistStructMethod = map[string]bool{ + // skipStructMethods lists "struct.method" combos to skip. + skipStructMethods = map[string]bool{ "RepositoryContent.GetContent": true, "Client.GetBaseURL": true, "Client.GetUploadURL": true, @@ -46,8 +46,8 @@ var ( "RateLimitError.GetResponse": true, "AbuseRateLimitError.GetResponse": true, } - // blacklistStruct lists structs to skip. - blacklistStruct = map[string]bool{ + // skipStructs lists structs to skip. + skipStructs = map[string]bool{ "Client": true, } ) @@ -104,9 +104,9 @@ func (t *templateData) processAST(f *ast.File) error { logf("Struct %v is unexported; skipping.", ts.Name) continue } - // Check if the struct is blacklisted. - if blacklistStruct[ts.Name.Name] { - logf("Struct %v is blacklisted; skipping.", ts.Name) + // Check if the struct should be skipped. + if skipStructs[ts.Name.Name] { + logf("Struct %v is in skip list; skipping.", ts.Name) continue } st, ok := ts.Type.(*ast.StructType) @@ -125,9 +125,9 @@ func (t *templateData) processAST(f *ast.File) error { logf("Field %v is unexported; skipping.", fieldName) continue } - // Check if "struct.method" is blacklisted. - if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); blacklistStructMethod[key] { - logf("Method %v is blacklisted; skipping.", key) + // Check if "struct.method" should be skipped. + if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); skipStructMethods[key] { + logf("Method %v is skip list; skipping.", key) continue } diff --git a/github/gen-stringify-test.go b/github/gen-stringify-test.go index 7803801e632..5474114bf98 100644 --- a/github/gen-stringify-test.go +++ b/github/gen-stringify-test.go @@ -39,10 +39,10 @@ const ( var ( verbose = flag.Bool("v", false, "Print verbose log messages") - // blacklistStructMethod lists "struct.method" combos to skip. - blacklistStructMethod = map[string]bool{} - // blacklistStruct lists structs to skip. - blacklistStruct = map[string]bool{ + // skipStructMethods lists "struct.method" combos to skip. + skipStructMethods = map[string]bool{} + // skipStructs lists structs to skip. + skipStructs = map[string]bool{ "RateLimits": true, } @@ -166,9 +166,9 @@ func (t *templateData) processAST(f *ast.File) error { logf("Struct %v is unexported; skipping.", ts.Name) continue } - // Check if the struct is blacklisted. - if blacklistStruct[ts.Name.Name] { - logf("Struct %v is blacklisted; skipping.", ts.Name) + // Check if the struct should be skipped. + if skipStructs[ts.Name.Name] { + logf("Struct %v is in skip list; skipping.", ts.Name) continue } st, ok := ts.Type.(*ast.StructType) @@ -203,9 +203,9 @@ func (t *templateData) processAST(f *ast.File) error { logf("Field %v is unexported; skipping.", fieldName) continue } - // Check if "struct.method" is blacklisted. - if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); blacklistStructMethod[key] { - logf("Method %v is blacklisted; skipping.", key) + // Check if "struct.method" should be skipped. + if key := fmt.Sprintf("%v.Get%v", ts.Name, fieldName); skipStructMethods[key] { + logf("Method %v is in skip list; skipping.", key) continue } diff --git a/update-urls/main.go b/update-urls/main.go index 3c07812467d..5309178f5fa 100644 --- a/update-urls/main.go +++ b/update-urls/main.go @@ -45,9 +45,9 @@ var ( verbose = flag.Bool("v", false, "Print verbose log messages") debugFile = flag.String("d", "", "Debug named file only") - // methodBlacklist holds methods that do not have GitHub v3 API URLs - // or are otherwise problematic in parsing, discovering, and/or fixing. - methodBlacklist = map[string]bool{ + // skipMethods holds methods which are skipped because they do not have GitHub v3 + // API URLs or are otherwise problematic in parsing, discovering, and/or fixing. + skipMethods = map[string]bool{ "ActionsService.DownloadArtifact": true, "AdminService.CreateOrg": true, "AdminService.CreateUser": true, @@ -679,7 +679,7 @@ func processAST(filename string, f *ast.File, services servicesMap, endpoints en } endpointName := decl.Name.Name fullName := fmt.Sprintf("%v.%v", serviceName, endpointName) - if methodBlacklist[fullName] { + if skipMethods[fullName] { logf("skipping %v", fullName) continue }