Skip to content

Commit 96ef664

Browse files
committed
- Fix pipeline issues
1 parent 02760fc commit 96ef664

File tree

15 files changed

+60
-42
lines changed

15 files changed

+60
-42
lines changed

.github/linters/.jscpd.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"threshold": 7,
3+
"reporters": ["console"],
4+
"ignore": [
5+
"**/*.min.js",
6+
"**/node_modules/**",
7+
"**/bin/**",
8+
"**/obj/**",
9+
"**/.git/**"
10+
],
11+
"format": [
12+
"csharp"
13+
],
14+
"minLines": 5,
15+
"minTokens": 100,
16+
"blame": false,
17+
"silent": false
18+
}

.jscpd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"threshold": 15,
2+
"threshold": 7,
33
"reporters": ["console"],
44
"ignore": [
55
"**/*.min.js",

src/SourceFlow.Net.EntityFramework/EntityDbContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static IEnumerable<Type> GetRegisteredTypes()
7474
{
7575
var assemblyTypes = assembly.GetTypes()
7676
.Where(t => t.IsClass && !t.IsAbstract &&
77-
t.GetInterfaces().Any(i => i.Name == "IEntity"));
77+
t.GetInterfaces().Any(i => i.Name == "IEntity"));
7878
foreach (var type in assemblyTypes)
7979
{
8080
types.Add(type);
@@ -113,7 +113,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
113113
{
114114
var types = assembly.GetTypes()
115115
.Where(t => t.IsClass && !t.IsAbstract &&
116-
t.GetInterfaces().Any(i => i.Name == "IEntity"));
116+
t.GetInterfaces().Any(i => i.Name == "IEntity"));
117117
foreach (var type in types)
118118
{
119119
entityTypes.Add(type);
@@ -125,15 +125,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
125125
// Auto-discover from loaded assemblies (fallback)
126126
var discoveredTypes = AppDomain.CurrentDomain.GetAssemblies()
127127
.Where(a => !a.IsDynamic && !a.FullName?.StartsWith("Microsoft.") == true
128-
&& !a.FullName?.StartsWith("System.") == true
129-
&& !a.FullName?.StartsWith("netstandard") == true)
128+
&& !a.FullName?.StartsWith("System.") == true
129+
&& !a.FullName?.StartsWith("netstandard") == true)
130130
.SelectMany(a =>
131131
{
132132
try { return a.GetTypes(); }
133133
catch { return Enumerable.Empty<Type>(); }
134134
})
135135
.Where(t => t.IsClass && !t.IsAbstract &&
136-
t.GetInterfaces().Any(i => i.Name == "IEntity"));
136+
t.GetInterfaces().Any(i => i.Name == "IEntity"));
137137

138138
foreach (var type in discoveredTypes)
139139
{

src/SourceFlow.Net.EntityFramework/Migrations/DbContextMigrationHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ PRIMARY KEY (""Id"")
101101
return null; // Skip complex types
102102

103103
var nullable = Nullable.GetUnderlyingType(property.PropertyType) != null ||
104-
(!propertyType.IsValueType && columnName != "Id");
104+
(!propertyType.IsValueType && columnName != "Id");
105105
var nullConstraint = nullable ? "" : " NOT NULL";
106106

107107
return $@"""{columnName}"" {sqlType}{nullConstraint}";

src/SourceFlow.Net.EntityFramework/Options/TableNamingConvention.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ private static string PluralizeName(string input)
124124
return input.Substring(0, input.Length - 1) + "ies";
125125
}
126126
else if (input.EndsWith("s", StringComparison.OrdinalIgnoreCase) ||
127-
input.EndsWith("x", StringComparison.OrdinalIgnoreCase) ||
128-
input.EndsWith("z", StringComparison.OrdinalIgnoreCase) ||
129-
input.EndsWith("ch", StringComparison.OrdinalIgnoreCase) ||
130-
input.EndsWith("sh", StringComparison.OrdinalIgnoreCase))
127+
input.EndsWith("x", StringComparison.OrdinalIgnoreCase) ||
128+
input.EndsWith("z", StringComparison.OrdinalIgnoreCase) ||
129+
input.EndsWith("ch", StringComparison.OrdinalIgnoreCase) ||
130+
input.EndsWith("sh", StringComparison.OrdinalIgnoreCase))
131131
{
132132
// class -> classes, box -> boxes
133133
return input + "es";

src/SourceFlow.Net.EntityFramework/Services/DatabaseResiliencePolicy.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ private ResiliencePipeline BuildResiliencePipeline(ResilienceOptions options)
8080
{
8181
MaxRetryAttempts = options.Retry.MaxRetryAttempts,
8282
ShouldHandle = new PredicateBuilder().Handle<DbUpdateException>()
83-
.Handle<TimeoutException>()
84-
.Handle<InvalidOperationException>(ex =>
85-
ex.Message.Contains("connection", StringComparison.OrdinalIgnoreCase) ||
86-
ex.Message.Contains("timeout", StringComparison.OrdinalIgnoreCase)),
83+
.Handle<TimeoutException>()
84+
.Handle<InvalidOperationException>(ex =>
85+
ex.Message.Contains("connection", StringComparison.OrdinalIgnoreCase) ||
86+
ex.Message.Contains("timeout", StringComparison.OrdinalIgnoreCase)),
8787
BackoffType = options.Retry.UseExponentialBackoff
8888
? DelayBackoffType.Exponential
8989
: DelayBackoffType.Constant,
@@ -104,10 +104,10 @@ private ResiliencePipeline BuildResiliencePipeline(ResilienceOptions options)
104104
MinimumThroughput = options.CircuitBreaker.FailureThreshold,
105105
BreakDuration = TimeSpan.FromMilliseconds(options.CircuitBreaker.BreakDurationMs),
106106
ShouldHandle = new PredicateBuilder().Handle<DbUpdateException>()
107-
.Handle<TimeoutException>()
108-
.Handle<InvalidOperationException>(ex =>
109-
ex.Message.Contains("connection", StringComparison.OrdinalIgnoreCase) ||
110-
ex.Message.Contains("timeout", StringComparison.OrdinalIgnoreCase))
107+
.Handle<TimeoutException>()
108+
.Handle<InvalidOperationException>(ex =>
109+
ex.Message.Contains("connection", StringComparison.OrdinalIgnoreCase) ||
110+
ex.Message.Contains("timeout", StringComparison.OrdinalIgnoreCase))
111111
};
112112

113113
pipelineBuilder.AddCircuitBreaker(circuitBreakerOptions);

src/SourceFlow.Net.EntityFramework/ViewModelDbContext.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static IEnumerable<Type> GetRegisteredTypes()
7474
{
7575
var assemblyTypes = assembly.GetTypes()
7676
.Where(t => t.IsClass && !t.IsAbstract &&
77-
t.GetInterfaces().Any(i => i.Name == "IViewModel"));
77+
t.GetInterfaces().Any(i => i.Name == "IViewModel"));
7878
foreach (var type in assemblyTypes)
7979
{
8080
types.Add(type);
@@ -113,7 +113,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
113113
{
114114
var types = assembly.GetTypes()
115115
.Where(t => t.IsClass && !t.IsAbstract &&
116-
t.GetInterfaces().Any(i => i.Name == "IViewModel"));
116+
t.GetInterfaces().Any(i => i.Name == "IViewModel"));
117117
foreach (var type in types)
118118
{
119119
viewModelTypes.Add(type);
@@ -125,15 +125,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
125125
// Auto-discover from loaded assemblies (fallback)
126126
var discoveredTypes = AppDomain.CurrentDomain.GetAssemblies()
127127
.Where(a => !a.IsDynamic && !a.FullName?.StartsWith("Microsoft.") == true
128-
&& !a.FullName?.StartsWith("System.") == true
129-
&& !a.FullName?.StartsWith("netstandard") == true)
128+
&& !a.FullName?.StartsWith("System.") == true
129+
&& !a.FullName?.StartsWith("netstandard") == true)
130130
.SelectMany(a =>
131131
{
132132
try { return a.GetTypes(); }
133133
catch { return Enumerable.Empty<Type>(); }
134134
})
135135
.Where(t => t.IsClass && !t.IsAbstract &&
136-
t.GetInterfaces().Any(i => i.Name == "IViewModel"));
136+
t.GetInterfaces().Any(i => i.Name == "IViewModel"));
137137

138138
foreach (var type in discoveredTypes)
139139
{

src/SourceFlow/Aggregate/EventSubscriber.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public Task Subscribe<TEvent>(TEvent @event) where TEvent : IEvent
5656
tasks.Add(eventSubscriber.On(@event));
5757

5858
logger?.LogInformation("Action=Event_Disptcher_Aggregate, Event={Event}, Aggregate={Aggregate}",
59-
typeof(TEvent).Name, aggregate.GetType().Name);
59+
typeof(TEvent).Name, aggregate.GetType().Name);
6060
}
6161

6262
return Task.WhenAll(tasks);

src/SourceFlow/IocExtensions.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,23 @@ private static IEnumerable<Type> GetImplementedTypes(Type interfaceType, Assembl
163163
{
164164
return a.GetTypes()
165165
.Where(t => interfaceType.IsAssignableFrom(t) &&
166-
t.IsClass &&
167-
!t.IsAbstract &&
168-
t.IsPublic &&
169-
!t.IsGenericType &&
170-
!t.ContainsGenericParameters);
166+
t.IsClass &&
167+
!t.IsAbstract &&
168+
t.IsPublic &&
169+
!t.IsGenericType &&
170+
!t.ContainsGenericParameters);
171171
}
172172
catch (ReflectionTypeLoadException)
173173
{
174174
// On cases where some types can't be loaded
175175
return a.GetTypes()
176176
.Where(t => t != null &&
177-
interfaceType.IsAssignableFrom(t) &&
178-
t.IsClass &&
179-
!t.IsAbstract &&
180-
t.IsPublic &&
181-
!t.IsGenericType &&
182-
!t.ContainsGenericParameters);
177+
interfaceType.IsAssignableFrom(t) &&
178+
t.IsClass &&
179+
!t.IsAbstract &&
180+
t.IsPublic &&
181+
!t.IsGenericType &&
182+
!t.ContainsGenericParameters);
183183
}
184184
catch
185185
{

src/SourceFlow/Messaging/Bus/ICommandBus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface ICommandBus
1515
/// <param name="event"></param>
1616
/// <returns></returns>
1717
Task Publish<TCommand>(TCommand command)
18-
where TCommand : ICommand;
18+
where TCommand : ICommand;
1919

2020
/// <summary>
2121
/// Replays all commands for a given aggregate.

0 commit comments

Comments
 (0)