diff --git a/docs/rules/0156/forbidden-methods.md b/docs/rules/0156/forbidden-methods.md index 0963b9f30..14d3dbfd5 100644 --- a/docs/rules/0156/forbidden-methods.md +++ b/docs/rules/0156/forbidden-methods.md @@ -2,7 +2,7 @@ rule: aip: 156 name: [core, '0156', forbidden-methods] - summary: Singletons must not define List, Create, or Delete methods. + summary: Singletons must not define Create, or Delete methods. permalink: /156/forbidden-methods redirect_from: - /0156/forbidden-methods @@ -10,15 +10,15 @@ redirect_from: # Singletons: Forbidden methods -This rule enforces that singleton resources do not define `List`, `Create`, or -`Delete` methods, as mandated in [AIP-156][]. +This rule enforces that singleton resources do not define `Create`, or `Delete` +methods, as mandated in [AIP-156][]. ## Details This rule looks at any message with a `name` variable in the URI where the name ends in anything other than `*`. It assumes that this is a method operating on -a singleton resource, and complains if the method is a `List`, `Create`, or -`Delete` standard method. +a singleton resource, and complains if the method is a `Create`, or `Delete` +standard method. ## Examples diff --git a/rules/aip0156/forbidden_methods.go b/rules/aip0156/forbidden_methods.go index eb1caed59..56f109c67 100644 --- a/rules/aip0156/forbidden_methods.go +++ b/rules/aip0156/forbidden_methods.go @@ -42,8 +42,8 @@ var forbiddenMethods = &lint.MethodRule{ return false }, LintMethod: func(m *desc.MethodDescriptor) []lint.Problem { - // Singletons should not use Create, List, or Delete. - for _, badPrefix := range []string{"Create", "List", "Delete"} { + // Singletons should not use Create, or Delete. + for _, badPrefix := range []string{"Create", "Delete"} { if strings.HasPrefix(m.GetName(), badPrefix) { return []lint.Problem{{ Message: fmt.Sprintf("Singletons must not define %q methods.", badPrefix), diff --git a/rules/aip0156/forbidden_methods_test.go b/rules/aip0156/forbidden_methods_test.go index 15423655a..8b3e1443a 100644 --- a/rules/aip0156/forbidden_methods_test.go +++ b/rules/aip0156/forbidden_methods_test.go @@ -29,8 +29,8 @@ func TestForbiddenMethods(t *testing.T) { }{ {"ValidGet", "GetPublisherSettings", "/settings", testutils.Problems{}}, {"ValidUpdate", "UpdatePublisherSettings", "/settings", testutils.Problems{}}, + {"ValidList", "ListPublisherSettings", "/settings", testutils.Problems{}}, {"InvalidCreate", "CreatePublisherSettings", "/settings", testutils.Problems{{Message: "Create"}}}, - {"InvalidList", "ListPublisherSettings", "/settings", testutils.Problems{{Message: "List"}}}, {"InvalidDelete", "DeletePublisherSettings", "/settings", testutils.Problems{{Message: "Delete"}}}, {"Irrelevant", "CreatePublisher", "", testutils.Problems{}}, } {