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

bazelisk.go: add simple .bazeliskrc file support #127

Closed
wants to merge 1 commit into from
Closed

bazelisk.go: add simple .bazeliskrc file support #127

wants to merge 1 commit into from

Conversation

zellyn
Copy link
Contributor

@zellyn zellyn commented Mar 23, 2020

Replace os.Getenv with getEnvOrConfig, which falls back to parsing
key=value pairs from a .bazeliskrc file in the workspace
root. Environment variables take precedence.

Aims to solve #119 as simply as possible.

Replace `os.Getenv` with `getEnvOrConfig`, which falls back to parsing
key=value pairs from a `.bazeliskrc` file in the workspace
root. Environment variables take precedence.

Aims to solve #119 as simply as possible.
@zellyn
Copy link
Contributor Author

zellyn commented Mar 23, 2020

fyi, @cheister

@joeljeske
Copy link

@philwo, is there anything that the community can do to help push this one through? I think this PR has a lot of merit, and would reduce configuration burden on newcomers to bazelisk.

@philwo
Copy link
Member

philwo commented Jun 22, 2020

@joeljeske Sorry, I've been super busy with finishing non-Bazelisk things that have to be done until end of this quarter - I'll get back to the issues and PRs here as soon as possible. Really looking forward to review / merge this and address any other open things.

@fweikert fweikert self-requested a review July 1, 2020 15:13
continue
}
key := strings.TrimSpace(parts[0])
if strings.HasPrefix(key, "#") {
Copy link
Member

Choose a reason for hiding this comment

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

Slightly more efficient if this check is the first line inside the loop

}

// Parse .bazeliskrc in the workspace root, once, if it can be found.
fileConfigOnce.Do(func() {
Copy link
Member

Choose a reason for hiding this comment

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

Optional: for my taste a bit too long for an anonymous function

Copy link
Member

@fweikert fweikert left a comment

Choose a reason for hiding this comment

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

Thank you for the feature! Please update the readme file and add a test

Copy link
Member

@philwo philwo left a comment

Choose a reason for hiding this comment

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

Will merge as soon as comments are addressed. Overall LGTM!

@philwo
Copy link
Member

philwo commented Jul 2, 2020

I talked with @fweikert, I'll just merge this now and we can polish later. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants