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

Improve contributing and development docs #1224

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@ If you are contributing code, please consider the following:
- Most changes should be accompanied with tests.
- All commits must be signed off (see next section).
- Related commits must be squashed before they are merged.
- All tests must pass and there must be no warnings from the `make check` target.
- All tests must pass and there must be no warnings from the `make
check` target.

If you are new to Go, consider reading [Effective
Go](https://golang.org/doc/effective_go.html) and [Go Code Review
Comments](https://github.com/golang/go/wiki/CodeReviewComments) for
guidance on writing idiomatic Go code.

When you implement new features in OPA, consider whether the
types/functions you are adding need to be exported. Prefer
unexported types and functions as much as possible.

If you need to share logic across multiple OPA packages, consider
implementing it inside of the
`github.com/open-policy-agent/opa/internal` package. The `internal`
package is not visible outside of OPA.

## Commit Messages

Expand Down
20 changes: 13 additions & 7 deletions docs/devel/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
layout: docs
title: Development
section: references
sort_order: 100
---

## Development

OPA is written in the [Go](https://golang.org) programming language.
Expand All @@ -28,6 +21,19 @@ After cloning the repository, just run `make`. This will:
- Run all of the tests.
- Run all of the static analysis checks.

If `make` fails with `main.go:20: running "pigeon": exec: "pigeon":
executable file not found in $PATH` make sure that `$GOPATH/bin` is
in `$PATH`. If `$GOPATH` is undefined, it defaults to
`$HOME/go/bin`:

```
export PATH=$PATH:$GOPATH/bin

# OR

export PATH=$PATH:$HOME/go/bin
```

If the build was successful, a binary will be produced in the top directory (`opa_<OS>_<ARCH>`).

Verify the build was successful with `./opa_<OS>_<ARCH> run`.
Expand Down