Skip to content

Latest commit

 

History

History
53 lines (33 loc) · 1.29 KB

File metadata and controls

53 lines (33 loc) · 1.29 KB

Truffle Common Code Repository

This repository is for storing functionality that (multiple) other repositories use.

What goes in common

Code that has a demonstrated need across > 1 repo.

What does not go in common

  • Business logic
  • Service-specific logic
  • Single-use logic

Policy/Process

Tests must be green before merging

Flaky tests are disabled and soon after deleted

Follow semantic versioning

Code guidelines

Be thoughtful about what's exported

Don't impose structure on callers; design to give callers control

Aim for 75% test coverage

  • Not a prerequisite for merging, though gaps in coverage should be explained in the PR
  • Testing every error condition not required
  • If 75% is hard, consider a refactor

Tests don't require external network access

Everything has a doc comment

  • Packages also have package-level doc comments
  • Doc comments on private functions/methods are reviewer's discretion

Add dependencies begrudgingly

  • Dependencies on other internal modules are not allowed

Disdain concurrency

When in doubt, add a comment

Wrap all errors from other modules before returning them

Target no later than the previous minor release of the language

  • For example, the latest go right now is 1.25.4, so only features available in 1.24.x are acceptable in common