{"action":"created","comment":{"url":"https://api.github.com/repos/mgechev/revive/pulls/comments/195353257","pull_request_review_id":128703568,"id":195353257,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTM1MzI1Nw==","diff_hunk":"@@ -0,0 +1,102 @@\n+package rule\n+\n+import (\n+\t\"fmt\"\n+\t\"go/ast\"\n+\t\"strings\"\n+\n+\t\"github.com/mgechev/revive/lint\"\n+)\n+\n+// ConfusingNamingRule lints method names that differ only by capitalization\n+type ConfusingNamingRule struct{}\n+\n+// Apply applies the rule to given file.\n+func (r *ConfusingNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure {\n+\tvar failures []lint.Failure\n+\n+\tfileAst := file.AST\n+\twalker := lintConfusingNames{\n+\t\tmethodNames: make(map[string][]*ast.Ident),\n+\t\tonFailure: func(failure lint.Failure) {\n+\t\t\tfailures = append(failures, failure)\n+\t\t},\n+\t}\n+\n+\tast.Walk(&walker, fileAst)\n+\n+\treturn failures\n+}\n+\n+// Name returns the rule name.\n+func (r *ConfusingNamingRule) Name() string {\n+\treturn \"confusing-naming\"\n+}\n+\n+//checkMethodName checks if a given method/function name is similar (just case differences) to other method/function of the same struct/file.","path":"rule/confusing-naming.go","position":74,"original_position":36,"commit_id":"7f9e2cc98145df5b015e9963b66a92a3fde73bdc","original_commit_id":"97315129a949f523d457d059570c92ffa2ac2a52","user":{"login":"chavacava","id":25788468,"node_id":"MDQ6VXNlcjI1Nzg4NDY4","avatar_url":"https://avatars2.githubusercontent.com/u/25788468?v=4","gravatar_id":"","url":"https://api.github.com/users/chavacava","html_url":"https://github.com/chavacava","followers_url":"https://api.github.com/users/chavacava/followers","following_url":"https://api.github.com/users/chavacava/following{/other_user}","gists_url":"https://api.github.com/users/chavacava/gists{/gist_id}","starred_url":"https://api.github.com/users/chavacava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavacava/subscriptions","organizations_url":"https://api.github.com/users/chavacava/orgs","repos_url":"https://api.github.com/users/chavacava/repos","events_url":"https://api.github.com/users/chavacava/events{/privacy}","received_events_url":"https://api.github.com/users/chavacava/received_events","type":"User","site_admin":false},"body":"I've pushed a version that, when applied to `revive` source, outputs:\r\n\r\n```\r\nvendor/golang.org/x/tools/godoc/vfs/namespace.go:263:21: Method 'Stat' differs only by capitalization to method 'stat' in the same source file\r\nvendor/golang.org/x/tools/godoc/vfs/zipfs/zipfs.go:186:18: Method 'Stat' differs only by capitalization to method 'stat' in the same source file\r\nvendor/golang.org/x/tools/container/intsets/sparse.go:1057:18: Method 'check' differs only by capitalization to method 'Check' in vendor/golang.org/x/tools/container/intsets/util_test.go\r\nvendor/golang.org/x/tools/go/buildutil/allpackages.go:84:6: Method 'allPackages' differs only by capitalization to function 'AllPackages' in the same source file\r\nvendor/golang.org/x/tools/refactor/rename/rename_test.go:1332:6: Method 'main' differs only by capitalization to function 'Main' in vendor/golang.org/x/tools/refactor/rename/rename.go\r\nvendor/github.com/BurntSushi/toml/encode.go:108:21: Method 'encode' differs only by capitalization to method 'Encode' in the same source file\r\nvendor/golang.org/x/tools/go/buildutil/util.go:112:6: Method 'hasSubdir' differs only by capitalization to function 'HasSubdir' in the same source file\r\nvendor/github.com/mattn/go-runewidth/runewidth_posix.go:62:6: Method 'IsEastAsian' differs only by capitalization to function 'isEastAsian' in the same source file\r\nvendor/golang.org/x/tools/go/ast/astutil/imports.go:443:6: Method 'Imports' differs only by capitalization to function 'imports' in the same source file\r\nvendor/golang.org/x/tools/godoc/analysis/analysis.go:267:20: Method 'FileInfo' differs only by capitalization to method 'fileInfo' in the same source file\r\nvendor/github.com/olekukonko/tablewriter/table.go:364:6: Method 'pad' differs only by capitalization to function 'Pad' in vendor/github.com/olekukonko/tablewriter/util.go\r\nvendor/golang.org/x/sys/unix/syscall_linux_amd64.go:78:6: Method 'Gettimeofday' differs only by capitalization to function 'gettimeofday' in vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go\r\nvendor/golang.org/x/tools/godoc/index_test.go:137:6: Method 'testIndex' differs only by capitalization to function 'TestIndex' in the same source file\r\nvendor/golang.org/x/tools/godoc/snippet.go:107:24: Method 'NewSnippet' differs only by capitalization to method 'newSnippet' in the same source file\r\nvendor/golang.org/x/tools/godoc/corpus.go:116:6: Method 'NewCorpus' differs only by capitalization to function 'newCorpus' in vendor/golang.org/x/tools/godoc/index_test.go\r\nvendor/golang.org/x/tools/godoc/server.go:741:24: Method 'serveFile' differs only by capitalization to method 'ServeFile' in the same source file\r\nvendor/golang.org/x/tools/godoc/godoc.go:912:24: Method 'WriteNode' differs only by capitalization to method 'writeNode' in the same source file\r\nvendor/golang.org/x/tools/go/ssa/builder.go:2262:19: Method 'build' differs only by capitalization to method 'Build' in the same source file\r\n```","created_at":"2018-06-14T09:17:35Z","updated_at":"2018-06-14T09:17:36Z","html_url":"https://github.com/mgechev/revive/pull/16#discussion_r195353257","pull_request_url":"https://api.github.com/repos/mgechev/revive/pulls/16","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mgechev/revive/pulls/comments/195353257"},"html":{"href":"https://github.com/mgechev/revive/pull/16#discussion_r195353257"},"pull_request":{"href":"https://api.github.com/repos/mgechev/revive/pulls/16"}},"in_reply_to_id":194268785},"pull_request":{"url":"https://api.github.com/repos/mgechev/revive/pulls/16","id":193821657,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzODIxNjU3","html_url":"https://github.com/mgechev/revive/pull/16","diff_url":"https://github.com/mgechev/revive/pull/16.diff","patch_url":"https://github.com/mgechev/revive/pull/16.patch","issue_url":"https://api.github.com/repos/mgechev/revive/issues/16","number":16,"state":"open","locked":false,"title":"New rule: Confusing naming","user":{"login":"chavacava","id":25788468,"node_id":"MDQ6VXNlcjI1Nzg4NDY4","avatar_url":"https://avatars2.githubusercontent.com/u/25788468?v=4","gravatar_id":"","url":"https://api.github.com/users/chavacava","html_url":"https://github.com/chavacava","followers_url":"https://api.github.com/users/chavacava/followers","following_url":"https://api.github.com/users/chavacava/following{/other_user}","gists_url":"https://api.github.com/users/chavacava/gists{/gist_id}","starred_url":"https://api.github.com/users/chavacava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavacava/subscriptions","organizations_url":"https://api.github.com/users/chavacava/orgs","repos_url":"https://api.github.com/users/chavacava/repos","events_url":"https://api.github.com/users/chavacava/events{/privacy}","received_events_url":"https://api.github.com/users/chavacava/received_events","type":"User","site_admin":false},"body":"Adds `confusing-naming`, a rule that warns on methods with names that differ only by capitalization (inspired by [FindBugs' _Nm: Confusing method names_](http://findbugs.sourceforge.net/bugDescriptions.html#NM_CONFUSING))","created_at":"2018-06-10T11:36:43Z","updated_at":"2018-06-14T09:17:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2515b420cb9d4576073678eb39e4bc0cb59e3ef","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mgechev/revive/pulls/16/commits","review_comments_url":"https://api.github.com/repos/mgechev/revive/pulls/16/comments","review_comment_url":"https://api.github.com/repos/mgechev/revive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mgechev/revive/issues/16/comments","statuses_url":"https://api.github.com/repos/mgechev/revive/statuses/7f9e2cc98145df5b015e9963b66a92a3fde73bdc","head":{"label":"chavacava:confusing-naming","ref":"confusing-naming","sha":"7f9e2cc98145df5b015e9963b66a92a3fde73bdc","user":{"login":"chavacava","id":25788468,"node_id":"MDQ6VXNlcjI1Nzg4NDY4","avatar_url":"https://avatars2.githubusercontent.com/u/25788468?v=4","gravatar_id":"","url":"https://api.github.com/users/chavacava","html_url":"https://github.com/chavacava","followers_url":"https://api.github.com/users/chavacava/followers","following_url":"https://api.github.com/users/chavacava/following{/other_user}","gists_url":"https://api.github.com/users/chavacava/gists{/gist_id}","starred_url":"https://api.github.com/users/chavacava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavacava/subscriptions","organizations_url":"https://api.github.com/users/chavacava/orgs","repos_url":"https://api.github.com/users/chavacava/repos","events_url":"https://api.github.com/users/chavacava/events{/privacy}","received_events_url":"https://api.github.com/users/chavacava/received_events","type":"User","site_admin":false},"repo":{"id":136333932,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYzMzM5MzI=","name":"revive","full_name":"chavacava/revive","owner":{"login":"chavacava","id":25788468,"node_id":"MDQ6VXNlcjI1Nzg4NDY4","avatar_url":"https://avatars2.githubusercontent.com/u/25788468?v=4","gravatar_id":"","url":"https://api.github.com/users/chavacava","html_url":"https://github.com/chavacava","followers_url":"https://api.github.com/users/chavacava/followers","following_url":"https://api.github.com/users/chavacava/following{/other_user}","gists_url":"https://api.github.com/users/chavacava/gists{/gist_id}","starred_url":"https://api.github.com/users/chavacava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavacava/subscriptions","organizations_url":"https://api.github.com/users/chavacava/orgs","repos_url":"https://api.github.com/users/chavacava/repos","events_url":"https://api.github.com/users/chavacava/events{/privacy}","received_events_url":"https://api.github.com/users/chavacava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chavacava/revive","description":"Fast (up to 6x faster than golint), configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.","fork":true,"url":"https://api.github.com/repos/chavacava/revive","forks_url":"https://api.github.com/repos/chavacava/revive/forks","keys_url":"https://api.github.com/repos/chavacava/revive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chavacava/revive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chavacava/revive/teams","hooks_url":"https://api.github.com/repos/chavacava/revive/hooks","issue_events_url":"https://api.github.com/repos/chavacava/revive/issues/events{/number}","events_url":"https://api.github.com/repos/chavacava/revive/events","assignees_url":"https://api.github.com/repos/chavacava/revive/assignees{/user}","branches_url":"https://api.github.com/repos/chavacava/revive/branches{/branch}","tags_url":"https://api.github.com/repos/chavacava/revive/tags","blobs_url":"https://api.github.com/repos/chavacava/revive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chavacava/revive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chavacava/revive/git/refs{/sha}","trees_url":"https://api.github.com/repos/chavacava/revive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chavacava/revive/statuses/{sha}","languages_url":"https://api.github.com/repos/chavacava/revive/languages","stargazers_url":"https://api.github.com/repos/chavacava/revive/stargazers","contributors_url":"https://api.github.com/repos/chavacava/revive/contributors","subscribers_url":"https://api.github.com/repos/chavacava/revive/subscribers","subscription_url":"https://api.github.com/repos/chavacava/revive/subscription","commits_url":"https://api.github.com/repos/chavacava/revive/commits{/sha}","git_commits_url":"https://api.github.com/repos/chavacava/revive/git/commits{/sha}","comments_url":"https://api.github.com/repos/chavacava/revive/comments{/number}","issue_comment_url":"https://api.github.com/repos/chavacava/revive/issues/comments{/number}","contents_url":"https://api.github.com/repos/chavacava/revive/contents/{+path}","compare_url":"https://api.github.com/repos/chavacava/revive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chavacava/revive/merges","archive_url":"https://api.github.com/repos/chavacava/revive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chavacava/revive/downloads","issues_url":"https://api.github.com/repos/chavacava/revive/issues{/number}","pulls_url":"https://api.github.com/repos/chavacava/revive/pulls{/number}","milestones_url":"https://api.github.com/repos/chavacava/revive/milestones{/number}","notifications_url":"https://api.github.com/repos/chavacava/revive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chavacava/revive/labels{/name}","releases_url":"https://api.github.com/repos/chavacava/revive/releases{/id}","deployments_url":"https://api.github.com/repos/chavacava/revive/deployments","created_at":"2018-06-06T13:38:04Z","updated_at":"2018-06-13T06:40:12Z","pushed_at":"2018-06-14T09:01:25Z","git_url":"git://github.com/chavacava/revive.git","ssh_url":"git@github.com:chavacava/revive.git","clone_url":"https://github.com/chavacava/revive.git","svn_url":"https://github.com/chavacava/revive","homepage":"https://mgv.io/revive","size":2751,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mgechev:master","ref":"master","sha":"fb3c2d09af6e2d84f636940969a3b14ac048d67c","user":{"login":"mgechev","id":455023,"node_id":"MDQ6VXNlcjQ1NTAyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/455023?v=4","gravatar_id":"","url":"https://api.github.com/users/mgechev","html_url":"https://github.com/mgechev","followers_url":"https://api.github.com/users/mgechev/followers","following_url":"https://api.github.com/users/mgechev/following{/other_user}","gists_url":"https://api.github.com/users/mgechev/gists{/gist_id}","starred_url":"https://api.github.com/users/mgechev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgechev/subscriptions","organizations_url":"https://api.github.com/users/mgechev/orgs","repos_url":"https://api.github.com/users/mgechev/repos","events_url":"https://api.github.com/users/mgechev/events{/privacy}","received_events_url":"https://api.github.com/users/mgechev/received_events","type":"User","site_admin":false},"repo":{"id":96237042,"node_id":"MDEwOlJlcG9zaXRvcnk5NjIzNzA0Mg==","name":"revive","full_name":"mgechev/revive","owner":{"login":"mgechev","id":455023,"node_id":"MDQ6VXNlcjQ1NTAyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/455023?v=4","gravatar_id":"","url":"https://api.github.com/users/mgechev","html_url":"https://github.com/mgechev","followers_url":"https://api.github.com/users/mgechev/followers","following_url":"https://api.github.com/users/mgechev/following{/other_user}","gists_url":"https://api.github.com/users/mgechev/gists{/gist_id}","starred_url":"https://api.github.com/users/mgechev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgechev/subscriptions","organizations_url":"https://api.github.com/users/mgechev/orgs","repos_url":"https://api.github.com/users/mgechev/repos","events_url":"https://api.github.com/users/mgechev/events{/privacy}","received_events_url":"https://api.github.com/users/mgechev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgechev/revive","description":"🔥 Linter for Go. ~6x faster, configurable, extensible, and beautiful drop-in replacement of golint.","fork":false,"url":"https://api.github.com/repos/mgechev/revive","forks_url":"https://api.github.com/repos/mgechev/revive/forks","keys_url":"https://api.github.com/repos/mgechev/revive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgechev/revive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgechev/revive/teams","hooks_url":"https://api.github.com/repos/mgechev/revive/hooks","issue_events_url":"https://api.github.com/repos/mgechev/revive/issues/events{/number}","events_url":"https://api.github.com/repos/mgechev/revive/events","assignees_url":"https://api.github.com/repos/mgechev/revive/assignees{/user}","branches_url":"https://api.github.com/repos/mgechev/revive/branches{/branch}","tags_url":"https://api.github.com/repos/mgechev/revive/tags","blobs_url":"https://api.github.com/repos/mgechev/revive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgechev/revive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgechev/revive/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgechev/revive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgechev/revive/statuses/{sha}","languages_url":"https://api.github.com/repos/mgechev/revive/languages","stargazers_url":"https://api.github.com/repos/mgechev/revive/stargazers","contributors_url":"https://api.github.com/repos/mgechev/revive/contributors","subscribers_url":"https://api.github.com/repos/mgechev/revive/subscribers","subscription_url":"https://api.github.com/repos/mgechev/revive/subscription","commits_url":"https://api.github.com/repos/mgechev/revive/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgechev/revive/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgechev/revive/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgechev/revive/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgechev/revive/contents/{+path}","compare_url":"https://api.github.com/repos/mgechev/revive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgechev/revive/merges","archive_url":"https://api.github.com/repos/mgechev/revive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgechev/revive/downloads","issues_url":"https://api.github.com/repos/mgechev/revive/issues{/number}","pulls_url":"https://api.github.com/repos/mgechev/revive/pulls{/number}","milestones_url":"https://api.github.com/repos/mgechev/revive/milestones{/number}","notifications_url":"https://api.github.com/repos/mgechev/revive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgechev/revive/labels{/name}","releases_url":"https://api.github.com/repos/mgechev/revive/releases{/id}","deployments_url":"https://api.github.com/repos/mgechev/revive/deployments","created_at":"2017-07-04T16:36:32Z","updated_at":"2018-06-14T08:01:07Z","pushed_at":"2018-06-14T09:01:26Z","git_url":"git://github.com/mgechev/revive.git","ssh_url":"git@github.com:mgechev/revive.git","clone_url":"https://github.com/mgechev/revive.git","svn_url":"https://github.com/mgechev/revive","homepage":"https://mgv.io/revive","size":2721,"stargazers_count":885,"watchers_count":885,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":11,"open_issues":1,"watchers":885,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mgechev/revive/pulls/16"},"html":{"href":"https://github.com/mgechev/revive/pull/16"},"issue":{"href":"https://api.github.com/repos/mgechev/revive/issues/16"},"comments":{"href":"https://api.github.com/repos/mgechev/revive/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/mgechev/revive/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/mgechev/revive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mgechev/revive/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/mgechev/revive/statuses/7f9e2cc98145df5b015e9963b66a92a3fde73bdc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chavacava"}}