Skip to content

Commit

Permalink
Ensure codespell failures fail CI (#5761)
Browse files Browse the repository at this point in the history
With the `write` option, codespell fixes issues (which is a nice
behavior when we run it locally), but it also returns a 0 status code
(except if some failures couldn't be fixed).

So in order to actually fix the CI on a failing codespell, we need to
ensure the working directory is clean.
  • Loading branch information
dmathieu authored Sep 3, 2024
1 parent 932a4d8 commit 38dfcb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codespell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ jobs:
uses: actions/checkout@v4
- name: Codespell
run: make codespell
- run: make check-clean-work-tree
6 changes: 3 additions & 3 deletions baggage/baggage.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type Property struct {
// component boundaries may impose their own restrictions on Property key.
// For example, the W3C Baggage specification restricts the Property keys to strings that
// satisfy the token definition from RFC7230, Section 3.2.6.
// For maximum compatibility, alpha-numeric value are strongly recommended to be used as Property key.
// For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key.
func NewKeyProperty(key string) (Property, error) {
if !validateBaggageName(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
Expand Down Expand Up @@ -90,7 +90,7 @@ func NewKeyValueProperty(key, value string) (Property, error) {
// component boundaries may impose their own restrictions on Property key.
// For example, the W3C Baggage specification restricts the Property keys to strings that
// satisfy the token definition from RFC7230, Section 3.2.6.
// For maximum compatibility, alpha-numeric value are strongly recommended to be used as Property key.
// For maximum compatibility, alphanumeric value are strongly recommended to be used as Property key.
func NewKeyValuePropertyRaw(key, value string) (Property, error) {
if !validateBaggageName(key) {
return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key)
Expand Down Expand Up @@ -287,7 +287,7 @@ func NewMember(key, value string, props ...Property) (Member, error) {
// component boundaries may impose their own restrictions on baggage key.
// For example, the W3C Baggage specification restricts the baggage keys to strings that
// satisfy the token definition from RFC7230, Section 3.2.6.
// For maximum compatibility, alpha-numeric value are strongly recommended to be used as baggage key.
// For maximum compatibility, alphanumeric value are strongly recommended to be used as baggage key.
func NewMemberRaw(key, value string, props ...Property) (Member, error) {
m := Member{
key: key,
Expand Down
2 changes: 1 addition & 1 deletion sdk/metric/internal/exemplar/filtered_reservoir.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewFilteredReservoir[N int64 | float64](f Filter, r Reservoir) FilteredRese

func (f *filteredReservoir[N]) Offer(ctx context.Context, val N, attr []attribute.KeyValue) {
if f.filter(ctx) {
// only record the current time if we are sampling this measurment.
// only record the current time if we are sampling this measurement.
f.reservoir.Offer(ctx, time.Now(), NewValue(val), attr)
}
}
Expand Down

0 comments on commit 38dfcb2

Please sign in to comment.