Skip to content
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

Distinguishes that there is an analysis error or there is not found app.conf #3

Closed
wants to merge 2 commits into from

Conversation

yuki2006
Copy link

@yuki2006 yuki2006 commented Jun 3, 2016

(Sorry for my poor English.)

"revel run project " is said to always be "no such file or directory" when you run even if there is a problem on app.conf.

example
https://raw.githubusercontent.com/yuki2006/revel_helloworld/master/conf/app.conf

2016/06/04 00:10:16 revel.go:163: Failed to load app.conf: open gopath/to/github.com/revel/revel/conf/app.conf: no such file or directory

It has been changed to the following

2016/06/04 00:16:38 revel.go:163: Failed to load app.conf: open gopath/to/project/conf/app.conf could not parse line: INIError

@jeevatkm jeevatkm self-assigned this Jun 3, 2016
@jeevatkm jeevatkm added this to the v0.13 milestone Jun 3, 2016
@@ -36,10 +38,14 @@ func LoadContext(confName string, confPaths []string) (*Context, error) {
var err error
var conf *Config
for _, confPath := range confPaths {
conf, err = ReadDefault(path.Join(confPath, confName))
filePath := path.Join(confPath, confName)
Copy link

Choose a reason for hiding this comment

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

Please use filepath.Join(confPath, confName).

@ghost
Copy link

ghost commented Jun 3, 2016

develop branch must be targetted or somebody will have to merge this manually.

@jeevatkm I guess effort-minutes, effort-hours, etc. tags make sense only for feature request like issues. Not for PRs. For issues you estimate how much time it will take to implement them. So, it's an element of planning.
These labels don't have sense in case of PRs bacause you don't know how much time it took contributor to implement that and you do not really need to know that because it's already done.

@@ -36,10 +38,14 @@ func LoadContext(confName string, confPaths []string) (*Context, error) {
var err error
var conf *Config
for _, confPath := range confPaths {
conf, err = ReadDefault(path.Join(confPath, confName))
filePath := path.Join(confPath, confName)
conf, err = ReadDefault(filePath)
if err == nil {
Copy link

Choose a reason for hiding this comment

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

Can you please change it to below:

if err != nil {
    return nil, fmt.Errorf("%v: %v", filePath, err)
} 

return &Context{config: conf}, nil

While reviewing this PR, I noticed LoadContext method only loads a first confPath from confPaths. So It needs an attention. I will create an issue for that separately.

@jeevatkm
Copy link

jeevatkm commented Jun 3, 2016

@alkchr - currently revel/config repo doesn't have develop branch. I will create one.

Regarding label effort-minutes is added for testing perspective to this PR before merge. I agree it will be contributor ready, but any one from @revel/core team must test before merging PR.

@jeevatkm
Copy link

jeevatkm commented Jun 3, 2016

@yuki2006 Thanks for contributing to Revel. Can you please take care of comments,gofmt, and rebase it?

@ghost
Copy link

ghost commented Jun 3, 2016

currently revel/config repo doesn't have develop branch.

@jeevatkm Yeah, my mistake. I didn't pay enough attention to the repo name.

Regarding label effort-minutes is added for testing perspective to this PR before merge. I agree it will be contributor ready, but any one from @revel/core team must test before merging PR.

From that perspective that makes sense. Though a new label can be introduced that would indicate that "LGTM" from core team is being awaited.

@yuki2006
Copy link
Author

yuki2006 commented Jun 4, 2016

Sorry. I used Reformat Code in IntelliJ IDEA with Go plugin.
I complete thought that it is the same as the go fmt...

@jeevatkm
Copy link

jeevatkm commented Jun 4, 2016

@yuki2006 no worries. I will be merging this PR. Also I will add line no of where that ini error occurred.

For example:

testdata/app-invalid.conf: could not parse line #7: <line of ini error>

@jeevatkm
Copy link

jeevatkm commented Jun 4, 2016

Manually targeted and merged to develop branch.

@jeevatkm jeevatkm closed this Jun 4, 2016
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.

None yet

2 participants