Skip to content

Commit

Permalink
Add codespell workflow (replaces misspell) (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored Feb 27, 2024
1 parent 43f728d commit c88027e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
skip = .git
21 changes: 21 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
20 changes: 0 additions & 20 deletions .github/workflows/misspell.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected override async Task StopCoreAsync(CancellationToken cancellationToken)
}

using var scope = CreateScope();
var datas = new List<EventData>();
var eventDatas = new List<EventData>();
foreach (var @event in events)
{
var body = await SerializeAsync(scope: scope,
Expand All @@ -192,16 +192,16 @@ protected override async Task StopCoreAsync(CancellationToken cancellationToken)
.AddIfNotDefault(MetadataNames.EventName, registration.EventName)
.AddIfNotDefault(MetadataNames.EventType, registration.EventType.FullName)
.AddIfNotDefault(MetadataNames.ActivityId, Activity.Current?.Id);
datas.Add(data);
eventDatas.Add(data);
}

// get the producer and send the events accordingly
var producer = await GetProducerAsync(reg: registration, deadletter: false, cancellationToken: cancellationToken).ConfigureAwait(false);
Logger.SendingEvents(events: events, eventHubName: producer.EventHubName, scheduled: scheduled);
await producer.SendAsync(datas, cancellationToken).ConfigureAwait(false);
await producer.SendAsync(eventDatas, cancellationToken).ConfigureAwait(false);

// return the sequence numbers
return scheduled != null ? datas.Select(m => new ScheduledResult(id: m.SequenceNumber, scheduled: scheduled.Value)).ToList() : null;
return scheduled != null ? eventDatas.Select(m => new ScheduledResult(id: m.SequenceNumber, scheduled: scheduled.Value)).ToList() : null;
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void ConfigureSerializer_Throws_InvalidOperationException()
[InlineData(typeof(TestEvent1), true, "dev", NamingConvention.KebabCase, "dev-tingle-event-bus-tests-configurator-test-event1")]
[InlineData(typeof(TestEvent1), true, "dev", NamingConvention.SnakeCase, "dev_tingle_event_bus_tests_configurator_test_event1")]
[InlineData(typeof(TestEvent1), true, "dev", NamingConvention.DotCase, "dev.tingle.event.bus.tests.configurator.test.event1")]
// Overriden by attribute
// Overridden by attribute
[InlineData(typeof(TestEvent2), true, "dev", NamingConvention.KebabCase, "sample-event")]
[InlineData(typeof(TestEvent2), true, "dev", NamingConvention.SnakeCase, "sample-event")]
[InlineData(typeof(TestEvent2), true, "dev", NamingConvention.DotCase, "sample-event")]
Expand Down Expand Up @@ -105,7 +105,7 @@ public void ConfigureEventName_Works(Type eventType, bool useFullTypeNames, stri
[InlineData(typeof(TestEvent1), typeof(TestConsumer1), true, "service1", ConsumerNameSource.PrefixAndTypeName, NamingConvention.DotCase,
"service1.tingle.event.bus.tests.configurator.test.consumer1")]

// Overriden by attribute
// Overridden by attribute
[InlineData(typeof(TestEvent2), typeof(TestConsumer2), false, null, ConsumerNameSource.TypeName, NamingConvention.SnakeCase, "sample-consumer")]
[InlineData(typeof(TestEvent2), typeof(TestConsumer2), false, null, ConsumerNameSource.Prefix, NamingConvention.SnakeCase, "sample-consumer")]
[InlineData(typeof(TestEvent2), typeof(TestConsumer2), false, "service1", ConsumerNameSource.PrefixAndTypeName, NamingConvention.SnakeCase, "sample-consumer")]
Expand Down

0 comments on commit c88027e

Please sign in to comment.