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

[direnv] Add basic .envrc.example #4747

Merged
merged 15 commits into from
Jan 3, 2024
9 changes: 9 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
toplevel="$(git rev-parse --show-toplevel)"

# build and use the managed go sdk
unset GOROOT
make -C "$toplevel" go-check
go_bin_path="$(make --no-print-directory -C $toplevel go-bin-path)"
PATH="$go_bin_path:$PATH"
Copy link
Member

Choose a reason for hiding this comment

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

make go-bin-path already appends the rest of the PATH so suffixing with $PATH shouldn't be required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! No wonder the path looked so long.


# add custom direnv initialization below here
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.build
.cache
.data
.envrc
.glide
.tmp
.DS_Store
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ implementation can easily serve the needs for an entire suite of tests and
the behavior is in a centralized location when it needs to be updated. Fakes
are also less inclined to be impacted by changes to usage patterns.

## Example [direnv][direnv_link] .envrc

We have committed a basic `.envrc.example`. If you use [direnv][direnv_link],
copy it into `.envrc`, edit as desired, and enable it with `direnv allow`. The
`.envrc` is `.gitignored`. Be aware that [source_env][source_env] is insecure
so keep your customizations in `.envrc`.

[direnv_link]: https://direnv.net/
[source_env]: https://direnv.net/man/direnv-stdlib.1.html#codesourceenv-ltfileordirpathgtcode

## Git hooks

We have checked in a pre-commit hook which enforces `go fmt` styling. Please install it
Expand Down
Loading