Skip to content

Commit 900479c

Browse files
committed
Run "dotnet format"
Fixes #1192 Also adds a format check to CI
1 parent f2c4b98 commit 900479c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+294
-286
lines changed

.editorconfig

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
# editorconfig.org
2-
3-
# top-most EditorConfig file
41
root = true
52

6-
# Default settings:
7-
# A newline ending every file
8-
# Use 4 spaces as indentation
3+
trim_trailing_whitespace = true
4+
95
[*]
106
insert_final_newline = true
117
indent_style = space
128
indent_size = 4
13-
trim_trailing_whitespace = true
149

15-
[project.json]
16-
indent_size = 2
17-
18-
# C# files
1910
[*.cs]
2011
# New line preferences
2112
csharp_new_line_before_open_brace = all
@@ -178,12 +169,13 @@ indent_size = 2
178169
[*.{props,targets,config,nuspec}]
179170
indent_size = 2
180171

181-
# Shell scripts
182172
[*.sh]
183173
end_of_line = lf
184174
[*.{cmd, bat}]
185175
end_of_line = crlf
186176

187-
# YAML files
177+
[*.json]
178+
indent_size = 2
179+
188180
[*.yml]
189181
indent_size = 2

.github/workflows/main.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,5 @@ jobs:
8686
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "net6.0"
8787
env:
8888
RABBITMQ_RABBITMQCTL_PATH: DOCKER:${{job.services.rabbitmq.id}}
89+
- name: Verify Formatting
90+
run: dotnet format --verbosity normal --no-restore --verify-no-changes

projects/Benchmarks/Networking/Networking_BasicDeliver_ConnectionChurn.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System.Text;
1+
using System;
2+
using System.Text;
23
using System.Threading.Tasks;
34
using BenchmarkDotNet.Attributes;
45
using RabbitMQ.Client;
5-
using System;
66

77
namespace Benchmarks.Networking
88
{
@@ -17,7 +17,7 @@ public class Networking_BasicDeliver
1717
[GlobalSetup]
1818
public void GlobalSetup()
1919
{
20-
_container = RabbitMQBroker.Start();
20+
_container = RabbitMQBroker.Start();
2121
}
2222

2323
[GlobalCleanup]

projects/Benchmarks/Networking/Networking_BasicDeliver_LongLivedConnection.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System.Threading.Tasks;
1+
using System;
2+
using System.Text;
3+
using System.Threading.Tasks;
24
using BenchmarkDotNet.Attributes;
35
using RabbitMQ.Client;
4-
using System;
5-
using System.Text;
66

77
namespace Benchmarks.Networking
88
{

projects/RabbitMQ.Client/client/api/ConnectionConfig.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
namespace RabbitMQ.Client
3838
{
39-
#nullable enable
39+
#nullable enable
4040
/// <summary>
4141
/// The configuration of a connection.
4242
/// </summary>

projects/RabbitMQ.Client/client/api/DefaultEndpointResolver.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public class DefaultEndpointResolver : IEndpointResolver
4040
private readonly List<AmqpTcpEndpoint> _endpoints;
4141
private readonly Random _rnd = new Random();
4242

43-
public DefaultEndpointResolver (IEnumerable<AmqpTcpEndpoint> tcpEndpoints)
43+
public DefaultEndpointResolver(IEnumerable<AmqpTcpEndpoint> tcpEndpoints)
4444
{
45-
_endpoints = tcpEndpoints.ToList();
45+
_endpoints = tcpEndpoints.ToList();
4646
}
4747

4848
public IEnumerable<AmqpTcpEndpoint> All()

projects/RabbitMQ.Client/client/api/ExchangeType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static class ExchangeType
6464
/// </summary>
6565
public const string Topic = "topic";
6666

67-
private static readonly string[] s_all = {Fanout, Direct, Topic, Headers};
67+
private static readonly string[] s_all = { Fanout, Direct, Topic, Headers };
6868

6969
/// <summary>
7070
/// Retrieve a collection containing all standard exchange types.

projects/RabbitMQ.Client/client/api/Headers.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ public static class Headers
5656
/// x-max-length-bytes header
5757
/// </summary>
5858
public const string XMaxLengthInBytes = "x-max-length-bytes";
59-
59+
6060
/// <summary>
6161
/// x-dead-letter-exchange header
6262
/// </summary>
6363
public const string XDeadLetterExchange = "x-dead-letter-exchange";
64-
64+
6565
/// <summary>
6666
/// x-dead-letter-routing-key header
6767
/// </summary>

projects/RabbitMQ.Client/client/api/IEndpointResolver.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ public interface IEndpointResolver
4040
/// </summary>
4141
IEnumerable<AmqpTcpEndpoint> All();
4242
}
43-
}
43+
}

projects/RabbitMQ.Client/client/api/IModelExtensions.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public static string BasicConsume(this IModel model,
4646
bool noLocal = false,
4747
bool exclusive = false,
4848
IDictionary<string, object> arguments = null)
49-
{
50-
return model.BasicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, consumer);
51-
}
49+
{
50+
return model.BasicConsume(queue, autoAck, consumerTag, noLocal, exclusive, arguments, consumer);
51+
}
5252

5353
/// <summary>Start a Basic content-class consumer.</summary>
5454
public static string BasicConsume(this IModel model, string queue, bool autoAck, IBasicConsumer consumer)
@@ -100,9 +100,9 @@ public static void BasicPublish(this IModel model, CachedString exchange, Cached
100100
/// </summary>
101101
public static QueueDeclareOk QueueDeclare(this IModel model, string queue = "", bool durable = false, bool exclusive = true,
102102
bool autoDelete = true, IDictionary<string, object> arguments = null)
103-
{
104-
return model.QueueDeclare(queue, durable, exclusive, autoDelete, arguments);
105-
}
103+
{
104+
return model.QueueDeclare(queue, durable, exclusive, autoDelete, arguments);
105+
}
106106

107107
/// <summary>
108108
/// (Extension method) Bind an exchange to an exchange.
@@ -125,18 +125,18 @@ public static void ExchangeBindNoWait(this IModel model, string destination, str
125125
/// </summary>
126126
public static void ExchangeDeclare(this IModel model, string exchange, string type, bool durable = false, bool autoDelete = false,
127127
IDictionary<string, object> arguments = null)
128-
{
129-
model.ExchangeDeclare(exchange, type, durable, autoDelete, arguments);
130-
}
128+
{
129+
model.ExchangeDeclare(exchange, type, durable, autoDelete, arguments);
130+
}
131131

132132
/// <summary>
133133
/// (Extension method) Like ExchangeDeclare but sets nowait to true.
134134
/// </summary>
135135
public static void ExchangeDeclareNoWait(this IModel model, string exchange, string type, bool durable = false, bool autoDelete = false,
136136
IDictionary<string, object> arguments = null)
137-
{
138-
model.ExchangeDeclareNoWait(exchange, type, durable, autoDelete, arguments);
139-
}
137+
{
138+
model.ExchangeDeclareNoWait(exchange, type, durable, autoDelete, arguments);
139+
}
140140

141141
/// <summary>
142142
/// (Spec method) Unbinds an exchange.
@@ -145,9 +145,9 @@ public static void ExchangeUnbind(this IModel model, string destination,
145145
string source,
146146
string routingKey,
147147
IDictionary<string, object> arguments = null)
148-
{
149-
model.ExchangeUnbind(destination, source, routingKey, arguments);
150-
}
148+
{
149+
model.ExchangeUnbind(destination, source, routingKey, arguments);
150+
}
151151

152152
/// <summary>
153153
/// (Spec method) Deletes an exchange.

projects/RabbitMQ.Client/client/api/ShutdownEventArgs.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public ShutdownEventArgs(ShutdownInitiator initiator, ushort replyCode, string r
9898
/// Override ToString to be useful for debugging.
9999
/// </summary>
100100
public override string ToString()
101-
{
102-
return $"AMQP close-reason, initiated by {Initiator}"
101+
{
102+
return $"AMQP close-reason, initiated by {Initiator}"
103103
+ $", code={ReplyCode}"
104104
+ (ReplyText != null ? $", text='{ReplyText}'" : string.Empty)
105105
+ $", classId={ClassId}"

0 commit comments

Comments
 (0)