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

Ensure exported interfaces have named method parameters #1172

Merged

Conversation

matej-g
Copy link
Contributor

@matej-g matej-g commented Sep 13, 2020

In line with the suggestion in #1135 (review), this PR intends to ensure exported interfaces have named method parameters by:

  • going over existing exported interfaces and naming method parameters where missing
  • updating the Style Guide to ensure this style choice is respected in future code changes

The aim of this change is to improve documentation and to bring about consistency in this matter.

Resolves #1138

@matej-g matej-g force-pushed the exported-interfaces-argument-names branch from d023703 to 1b118b2 Compare September 13, 2020 20:14
@codecov
Copy link

codecov bot commented Sep 13, 2020

Codecov Report

Merging #1172 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1172   +/-   ##
======================================
  Coverage    77.9%   77.9%           
======================================
  Files         135     135           
  Lines        7192    7192           
======================================
  Hits         5603    5603           
  Misses       1346    1346           
  Partials      243     243           
Impacted Files Coverage Δ
api/metric/metrictest/async.go 78.1% <ø> (ø)
api/metric/sdkapi.go 100.0% <ø> (ø)
api/propagation/propagation.go 100.0% <ø> (ø)
api/trace/tracetest/config.go 91.8% <ø> (ø)
label/encoder.go 88.5% <ø> (ø)
sdk/export/metric/metric.go 97.6% <ø> (ø)
sdk/metric/controller/time/time.go 75.0% <ø> (ø)
sdk/metric/processor/reducer/reducer.go 100.0% <ø> (ø)
sdk/trace/sampling.go 100.0% <ø> (ø)
sdk/resource/auto.go 0.0% <0.0%> (ø)

@XSAM
Copy link
Member

XSAM commented Sep 14, 2020

Should we update these *Option interfaces too? These interfaces also exported.

e.g.

// InstrumentOption is an interface for applying instrument options.
type InstrumentOption interface {
// ApplyMeter is used to set a InstrumentOption value of a
// InstrumentConfig.
ApplyInstrument(*InstrumentConfig)
}

@matej-g
Copy link
Contributor Author

matej-g commented Sep 14, 2020

Should we update these *Option interfaces too? These interfaces also exported.

I was considering that as well, but in the end decided not to, as it seemed to me that these interfaces are part of the "standardized" style (https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#option) and therefore should be clear enough on their own. But I'm not opposed to including it there as well if that's the preference here.

@Aneurysm9
Copy link
Member

Should we update these *Option interfaces too? These interfaces also exported.

I was considering that as well, but in the end decided not to, as it seemed to me that these interfaces are part of the "standardized" style (https://github.com/open-telemetry/opentelemetry-go/blob/master/CONTRIBUTING.md#option) and therefore should be clear enough on their own. But I'm not opposed to including it there as well if that's the preference here.

I'm on the fence about this. I think that generally the Option interfaces will be dealing with internal types and won't be used by end-users, but I can also see the argument that they should be documented for consistency.

@rakyll do you have thoughts on this?

@MrAlias
Copy link
Contributor

MrAlias commented Sep 15, 2020

Should we update these *Option interfaces too? These interfaces also exported.

I don't think this should block this PR but indeed is a good question. I'm as well on the fence. I think the repeated pattern and having this pattern pretty well documented in our style guide makes this clear.

@MrAlias MrAlias merged commit a12224a into open-telemetry:master Sep 16, 2020
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure exported interface types include parameter names
6 participants