Skip to content

golint fixes for cliconfig#14776

Merged
runcom merged 1 commit intomoby:masterfrom
MHBauer:cliconfig-lint
Jul 21, 2015
Merged

golint fixes for cliconfig#14776
runcom merged 1 commit intomoby:masterfrom
MHBauer:cliconfig-lint

Conversation

@MHBauer
Copy link
Contributor

@MHBauer MHBauer commented Jul 20, 2015

my part for #14756

  • fully capitalize HTTP in HTTPHeaders
  • comment for CONFIGFILE
  • camelcase and privatize oldConfigfile, defaultIndexserver, errConfigFileMissing
  • comments for methods and functions throughout
  • external references to renamed variable changed

Signed-off-by: Morgan Bauer mbauer@us.ibm.com

@MHBauer
Copy link
Contributor Author

MHBauer commented Jul 20, 2015

should 'errConfigFileMissing' be totally removed? I see no references to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird golint doesn't highlight this one :/ probably because it's not underscored, I'd prefer to have it called ConfigFileName (or configFileName if it isn't exported and since configFile is declared below and would conflict otherwise) then, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it strange as well. I'm guessing it's some odd case in golint.

This is the only exported usage I see.
registry/auth_test.go
37: root = filepath.Join(root, cliconfig.CONFIGFILE)

I agree on the recase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, we can call it ConfigFileName so it's not all uppercase

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be awere CONFIGFILE is used even in config_file_test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, there is also a struct in this unit called ConfigFile. How about ConfigFilename?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MHBauer yes, either configFileName or configFilename will work

@runcom
Copy link
Member

runcom commented Jul 20, 2015

@MHBauer yup ErrConfigFileMissing could be removed since it seems unused ping @duglin if you know more about this

@duglin
Copy link
Contributor

duglin commented Jul 20, 2015

yep - couldn't find it - so kill it

@MHBauer
Copy link
Contributor Author

MHBauer commented Jul 20, 2015

possibly a nit, should config_file_test.go be named config_test.go ?

@runcom
Copy link
Member

runcom commented Jul 20, 2015

@MHBauer yes you could rename test file also

 - fully capitalize HTTP in HTTPHeaders
 - comment for CONFIGFILE
 - camelcase and privatize oldConfigfile, defaultIndexserver
 - remove unused var errConfigFileMissing
 - comments for methods and functions throughout
 - external references to renamed variables changed

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
@duglin
Copy link
Contributor

duglin commented Jul 20, 2015

LGTM assuming janky is happy

@runcom
Copy link
Member

runcom commented Jul 21, 2015

LGTM

runcom added a commit that referenced this pull request Jul 21, 2015
@runcom runcom merged commit 4c0fb85 into moby:master Jul 21, 2015
@MHBauer MHBauer deleted the cliconfig-lint branch July 21, 2015 01:00
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MHBauer this is incorrect, it should be ConfigFileName. And please add cliconfig to the list in ./hack/make/validate-lint. You can send a new PR if you want :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for giving me the chance to fix this. see #15175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants