Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.49 KB

File metadata and controls

23 lines (14 loc) · 1.49 KB

Contributing

sumup-go consists of a code generator tool under ./internal/cmd/codegen and the SDK itself which lives in the root. Those two are co-maintained here as the codegen tool is highly opinionated and tightly coupled to the SDK itself. Furthermore, their coexistence in this repository makes it easier to iterate on new features and changes. The loop is:

  1. Update codegen tool with desired changes.
  2. Generate code using make generate.
  3. Inspect changes / ensure that the SDK compiles (e.g. using make test)

Not all code in the SDK is generated. Files that are, are marked with "// Code generated by go-sdk-gen. DO NOT EDIT." on the first line.

Standards

In the SDK, we avoid dependencies unless absolutely necessary. The SDK should be as agnostic as possible to the choice of technology of the end-users.

In the codegen tool relies on github.com/pb33f/libopenapi for most of the heavy lifting. The tool is a bit a messy but the main logic is:

  1. Load the OpenAPI specs
  2. Reorganize them into intermediate representation that uses serializable builder.Writable
  3. Generate the SDK using combination of go templates and serializable blocks of code that are generated as a raw strings.

Conventional Commits

sumup-go uses Conventional Commits which are used to generate changelog. All PR titles must follow the conventional commits standard. Ideally, use Conventional Commits for commits themselves too.