Skip to content

Commit

Permalink
[chore][docs] Reflect current practices about configuration structs i…
Browse files Browse the repository at this point in the history
…n coding guidelines
  • Loading branch information
mx-psi committed Oct 28, 2024
1 parent 7f6dc01 commit 913aea9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ To keep naming patterns consistent across the project, naming patterns are enfor
- `func CreateTracesExport(...) {...}`
- `func CreateTracesToTracesFunc(...) {...}`

#### Configuration structs

When naming configuration structs, use the following guidelines:

- Separate the configuration set by end users in their YAML configuration from the configuration set by developers in the code into different structs.
- Use the `Config` suffix for configuration structs that have end user configuration (i.e. that set in their YAML configuration). For example, `configgrpc.ClientConfig` ends in `Config` since it contains end user configuration.
- Use the `Settings` suffix for configuration structs that are set by developers in the code. For example, `component.TelemetrySettings` ends in `Settings` since it is set by developers in the code.
- Avoid redundant prefixes that are already implied by the package name. For example, use`configgrpc.ClientConfig` instead of `configgrpc.GRPCClientConfig`.

### Enumerations

To keep naming patterns consistent across the project, enumeration patterns are enforced to make intent clear:
Expand Down

0 comments on commit 913aea9

Please sign in to comment.