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

Add codespell workflow (replaces misspell) #591

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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