-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Use MixedCase constant names #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
According to the provided link, const variables must starts with lower char.
|
Lowercase is for unexported @0xBAADF00D |
LGTM |
Current coverage is 2.24% (diff: 2.07%)@@ master #110 diff @@
========================================
Files 32 32
Lines 7521 7521
Methods 0 0
Messages 0 0
Branches 0 0
========================================
Hits 169 169
Misses 7335 7335
Partials 17 17
|
LGTM |
// Reference from a comment | ||
COMMENT_TYPE_COMMENT_REF | ||
CommentTypeComment_REF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight mistake
LOGIN_DLDAP // 5 | ||
LoginNotype LoginType = iota | ||
LoginPlain // 1 | ||
LoginLdap // 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LDAP, SMTP, PAM, DLDAP are all abbreviations and should be upper-case (Golang allows this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I believe it should be LoginNoType
on the first one :)
@@ -28,13 +28,13 @@ var HookQueue = sync.NewUniqueQueue(setting.Webhook.QueueLength) | |||
type HookContentType int | |||
|
|||
const ( | |||
JSON HookContentType = iota + 1 | |||
FORM | |||
ContentTypeJson HookContentType = iota + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON
should be upper-case
SECURITY_PROTOCOL_START_TLS | ||
SecurityProtocolUnencrypted SecurityProtocol = iota | ||
SecurityProtocolLdaps | ||
SecurityProtocolStartTls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LDAPS
and TLS
are upper-case
@@ -22,7 +22,7 @@ const ( | |||
SETTINGS_OPTIONS base.TplName = "repo/settings/options" | |||
COLLABORATION base.TplName = "repo/settings/collaboration" | |||
GITHOOKS base.TplName = "repo/settings/githooks" | |||
GITHOOK_EDIT base.TplName = "repo/settings/githook_edit" | |||
GithookEdit base.TplName = "repo/settings/githook_edit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this one and not the others?
HOOK_NEW base.TplName = "repo/settings/hook_new" | ||
ORG_HOOK_NEW base.TplName = "org/settings/hook_new" | ||
HookNew base.TplName = "repo/settings/hook_new" | ||
ORG_HookNew base.TplName = "org/settings/hook_new" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed HOOKS
and ORG_HookNew
is wrong :)
case "admin": | ||
return ACCESS_MODE_ADMIN | ||
return AccessModeAdmin | ||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not exactly related, but shouldn't this function have
case "owner":
return AccessModeOwner
as well?
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
LDAP, SMTP, PAM, DLDAP are all abbreviations and should be upper-case (Golang allows this)
How could you ever make them non-exported if you spell them
uppercase for being abbreviations ?
|
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
Please review #111 |
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
Also fixed in pr #111 |
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
Fixed in #111 with [typos ee9b6e9] |
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
PR #111, [typos 10fa115] |
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
[typos f18d87b] in pr #111 |
On Mon, Nov 07, 2016 at 10:24:15AM -0800, bkcsoft wrote:
[typos 5c184e2] in pr #111 |
On Mon, Nov 07, 2016 at 10:26:14AM -0800, bkcsoft wrote:
I've also noted Owner and Admin and not sure both are used |
resolved #70 |
* Fix tree entry parsing * nits * populate TreeEntry.ptree
See https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps