Skip to content

Commit

Permalink
Remove incomplete example used here (open-telemetry#4715)
Browse files Browse the repository at this point in the history
* Remove incomplete example used here

* Adopting rfc2119 naming

* Fixing table for github

* correcting rfc use
  • Loading branch information
MovieStoreGuy authored Jan 31, 2022
1 parent 61f4155 commit 483e6e1
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,15 @@ To keep naming patterns consistent across the project, naming patterns are enfor
- Methods that return a variable that uses the zero value or values provided via the method MUST have the prefix `New`. For example:
- `func NewKinesisExporter(kpl aws.KinesisProducerLibrary)` allocates a variable that uses
the variables passed on creation.
- `func NewKeyValueBuilder()` may allocate internal varialbes to a safe zero value.
- Methods that return a variable that uses non zero value(s) that impacts business logic must use `NewDefault`. For example:
- `func NewKeyValueBuilder()` SHOULD allocate internal variables to a safe zero value.
- Methods that return a variable that uses non zero value(s) that impacts business logic MUST use the prefix `NewDefault`. For example:
- `func NewDefaultKinesisConfig()` would return a configuration that is the suggested default
and can be updated without concern of a race condition.
- Methods that act upon an input variable should have a signature that reflect concisely the logic being done. For example:
- `func FilterAttributes(attrs []Attribute, match func(attr Attribute) bool) []Attribute` must only filter attributes out of the passed input
- Methods that act upon an input variable MUST have a signature that reflect concisely the logic being done. For example:
- `func FilterAttributes(attrs []Attribute, match func(attr Attribute) bool) []Attribute` MUST only filter attributes out of the passed input
slice and return a new slice with values that `match` returns true. It may not do more work than what the method name implies, ie, it
may not key a global history of all the slices that have been filtered.
- `func Add(v pdata.values)`
- Variable assigned in a package's global scope that is preconfigured with a recommended set of values must use `Default` as the prefix. For example:
must not key a global history of all the slices that have been filtered.
- Variable assigned in a package's global scope that is preconfigured with a default set of values MUST use `Default` as the prefix. For example:
- `var DefaultMarshallers = map[string]pdata.Marshallers{...}` is defined with an exporters package that allows for converting an encoding name,
`zipkin`, and return the preconfigured marshaller to be used in the export process.

Expand All @@ -226,10 +225,10 @@ To keep naming patterns consistent across the project, naming patterns are enfor
In order to simplify developing within the project, library recommendations have been set
and should be followed.

| Scenario | Recommended | Rationale |
| ----------------------------------------------------------------------------|
| Hashing | ["hashing/fnv"](https://pkg.go.dev/hash/fnv) | The project adopted this as the default hashing method due to the efficiency and is reasonable for non cryptographic use |
| Testing | Use `t.Parallel()` where possible | Enabling more test to be run in parallel will speed up the feedback process when working on the project. |
| Scenario | Recommended | Rationale |
|---------- |---------------------------------------------- |-------------------------------------------------------------------------------------------------------------------------- |
| Hashing | ["hashing/fnv"](https://pkg.go.dev/hash/fnv) | The project adopted this as the default hashing method due to the efficiency and is reasonable for non cryptographic use |
| Testing | Use `t.Parallel()` where possible | Enabling more test to be run in parallel will speed up the feedback process when working on the project. |


Within the project, there are some packages that are yet to follow the recommendations and are being address, however, any new code should adhere to the recommendations.
Expand Down

0 comments on commit 483e6e1

Please sign in to comment.