Skip to content

Commit f745b3f

Browse files
committed
Use <see langword="..."/> for language keywords.
1 parent 42ff920 commit f745b3f

File tree

115 files changed

+683
-677
lines changed

Some content is hidden

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

115 files changed

+683
-677
lines changed

.editorconfig

+6
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,12 @@ dotnet_diagnostic.CA1510.severity = none
488488
# Since we do not enable any of the Sonar rules by default, we'll leave CA1725 enabled.
489489
dotnet_diagnostic.CA1725.severity = error
490490

491+
# CA1825: Avoid zero-length array allocations
492+
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825
493+
#
494+
# This is a duplicate of MA0005.
495+
dotnet_diagnostic.CA1825.severity = none
496+
491497
# CA1819: Properties should not return arrays
492498
#
493499
# Arrays offer better performance than collections.

src/Renci.SshNet/Abstractions/CryptoAbstraction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static byte[] GenerateRandom(int length)
2323
/// Fills an array of bytes with a cryptographically strong random sequence of values.
2424
/// </summary>
2525
/// <param name="data">The array to fill with cryptographically strong random bytes.</param>
26-
/// <exception cref="ArgumentNullException"><paramref name="data"/> is <c>null</c>.</exception>
26+
/// <exception cref="ArgumentNullException"><paramref name="data"/> is <see langword="null"/>.</exception>
2727
/// <remarks>
2828
/// The length of the byte array determines how many random bytes are produced.
2929
/// </remarks>

src/Renci.SshNet/Abstractions/DnsAbstraction.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal static class DnsAbstraction
3030
/// An array of type <see cref="IPAddress"/> that holds the IP addresses for the host that
3131
/// is specified by the <paramref name="hostNameOrAddress"/> parameter.
3232
/// </returns>
33-
/// <exception cref="ArgumentNullException"><paramref name="hostNameOrAddress"/> is <c>null</c>.</exception>
33+
/// <exception cref="ArgumentNullException"><paramref name="hostNameOrAddress"/> is <see langword="null"/>.</exception>
3434
/// <exception cref="SocketException">An error is encountered when resolving <paramref name="hostNameOrAddress"/>.</exception>
3535
public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
3636
{
@@ -97,7 +97,7 @@ public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
9797
/// A task with result of an array of type <see cref="IPAddress"/> that holds the IP addresses for the host that
9898
/// is specified by the <paramref name="hostNameOrAddress"/> parameter.
9999
/// </returns>
100-
/// <exception cref="ArgumentNullException"><paramref name="hostNameOrAddress"/> is <c>null</c>.</exception>
100+
/// <exception cref="ArgumentNullException"><paramref name="hostNameOrAddress"/> is <see langword="null"/>.</exception>
101101
/// <exception cref="SocketException">An error is encountered when resolving <paramref name="hostNameOrAddress"/>.</exception>
102102
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress)
103103
{

src/Renci.SshNet/Abstractions/SocketAbstraction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static bool CanRead(Socket socket)
2828
/// </summary>
2929
/// <param name="socket">The <see cref="Socket"/> to check.</param>
3030
/// <returns>
31-
/// <c>true</c> if <paramref name="socket"/> can be written to; otherwise, <c>false</c>.
31+
/// <see langword="true"/> if <paramref name="socket"/> can be written to; otherwise, <see langword="false"/>.
3232
/// </returns>
3333
public static bool CanWrite(Socket socket)
3434
{

src/Renci.SshNet/AuthenticationMethod.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public abstract class AuthenticationMethod : IAuthenticationMethod
2929
/// Initializes a new instance of the <see cref="AuthenticationMethod"/> class.
3030
/// </summary>
3131
/// <param name="username">The username.</param>
32-
/// <exception cref="ArgumentException"><paramref name="username"/> is whitespace or <c>null</c>.</exception>
32+
/// <exception cref="ArgumentException"><paramref name="username"/> is whitespace or <see langword="null"/>.</exception>
3333
protected AuthenticationMethod(string username)
3434
{
3535
if (string.IsNullOrWhiteSpace(username))

src/Renci.SshNet/BaseClient.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private set
6969
/// Gets a value indicating whether this client is connected to the server.
7070
/// </summary>
7171
/// <value>
72-
/// <c>true</c> if this client is connected; otherwise, <c>false</c>.
72+
/// <see langword="true"/> if this client is connected; otherwise, <see langword="false"/>.
7373
/// </value>
7474
/// <exception cref="ObjectDisposedException">The method was called after the client was disposed.</exception>
7575
public bool IsConnected
@@ -158,9 +158,9 @@ public TimeSpan KeepAliveInterval
158158
/// </summary>
159159
/// <param name="connectionInfo">The connection info.</param>
160160
/// <param name="ownsConnectionInfo">Specified whether this instance owns the connection info.</param>
161-
/// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is <c>null</c>.</exception>
161+
/// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is <see langword="null"/>.</exception>
162162
/// <remarks>
163-
/// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, then the
163+
/// If <paramref name="ownsConnectionInfo"/> is <see langword="true"/>, then the
164164
/// connection info will be disposed when this instance is disposed.
165165
/// </remarks>
166166
protected BaseClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
@@ -174,10 +174,10 @@ protected BaseClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo)
174174
/// <param name="connectionInfo">The connection info.</param>
175175
/// <param name="ownsConnectionInfo">Specified whether this instance owns the connection info.</param>
176176
/// <param name="serviceFactory">The factory to use for creating new services.</param>
177-
/// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is <c>null</c>.</exception>
178-
/// <exception cref="ArgumentNullException"><paramref name="serviceFactory"/> is <c>null</c>.</exception>
177+
/// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is <see langword="null"/>.</exception>
178+
/// <exception cref="ArgumentNullException"><paramref name="serviceFactory"/> is <see langword="null"/>.</exception>
179179
/// <remarks>
180-
/// If <paramref name="ownsConnectionInfo"/> is <c>true</c>, then the
180+
/// If <paramref name="ownsConnectionInfo"/> is <see langword="true"/>, then the
181181
/// connection info will be disposed when this instance is disposed.
182182
/// </remarks>
183183
private protected BaseClient(ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory)
@@ -402,7 +402,7 @@ public void Dispose()
402402
/// <summary>
403403
/// Releases unmanaged and - optionally - managed resources.
404404
/// </summary>
405-
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
405+
/// <param name="disposing"><see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release only unmanaged resources.</param>
406406
protected virtual void Dispose(bool disposing)
407407
{
408408
if (_isDisposed)
@@ -566,7 +566,7 @@ private void DisposeSession(ISession session)
566566
}
567567

568568
/// <summary>
569-
/// Disposes the SSH session, and assigns <c>null</c> to <see cref="Session"/>.
569+
/// Disposes the SSH session, and assigns <see langword="null"/> to <see cref="Session"/>.
570570
/// </summary>
571571
private void DisposeSession()
572572
{
@@ -582,7 +582,7 @@ private void DisposeSession()
582582
/// Returns a value indicating whether the SSH session is established.
583583
/// </summary>
584584
/// <returns>
585-
/// <c>true</c> if the SSH session is established; otherwise, <c>false</c>.
585+
/// <see langword="true"/> if the SSH session is established; otherwise, <see langword="false"/>.
586586
/// </returns>
587587
private bool IsSessionConnected()
588588
{

src/Renci.SshNet/Channels/Channel.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ internal abstract class Channel : IChannel
2929
/// Holds a value indicating whether the SSH_MSG_CHANNEL_CLOSE has been sent to the remote party.
3030
/// </summary>
3131
/// <value>
32-
/// <c>true</c> when a SSH_MSG_CHANNEL_CLOSE message has been sent to the other party;
33-
/// otherwise, <c>false</c>.
32+
/// <see langword="true"/> when a SSH_MSG_CHANNEL_CLOSE message has been sent to the other party;
33+
/// otherwise, <see langword="false"/>.
3434
/// </value>
3535
private bool _closeMessageSent;
3636

@@ -39,26 +39,26 @@ internal abstract class Channel : IChannel
3939
/// party.
4040
/// </summary>
4141
/// <value>
42-
/// <c>true</c> when a SSH_MSG_CHANNEL_CLOSE message has been received from the other party;
43-
/// otherwise, <c>false</c>.
42+
/// <see langword="true"/> when a SSH_MSG_CHANNEL_CLOSE message has been received from the other party;
43+
/// otherwise, <see langword="false"/>.
4444
/// </value>
4545
private bool _closeMessageReceived;
4646

4747
/// <summary>
4848
/// Holds a value indicating whether the SSH_MSG_CHANNEL_EOF has been received from the other party.
4949
/// </summary>
5050
/// <value>
51-
/// <c>true</c> when a SSH_MSG_CHANNEL_EOF message has been received from the other party;
52-
/// otherwise, <c>false</c>.
51+
/// <see langword="true"/> when a SSH_MSG_CHANNEL_EOF message has been received from the other party;
52+
/// otherwise, <see langword="false"/>.
5353
/// </value>
5454
private bool _eofMessageReceived;
5555

5656
/// <summary>
5757
/// Holds a value indicating whether the SSH_MSG_CHANNEL_EOF has been sent to the remote party.
5858
/// </summary>
5959
/// <value>
60-
/// <c>true</c> when a SSH_MSG_CHANNEL_EOF message has been sent to the remote party;
61-
/// otherwise, <c>false</c>.
60+
/// <see langword="true"/> when a SSH_MSG_CHANNEL_EOF message has been sent to the remote party;
61+
/// otherwise, <see langword="false"/>.
6262
/// </value>
6363
private bool _eofMessageSent;
6464

@@ -221,7 +221,7 @@ private set
221221
/// Gets or sets a value indicating whether this channel is open.
222222
/// </summary>
223223
/// <value>
224-
/// <c>true</c> if this channel is open; otherwise, <c>false</c>.
224+
/// <see langword="true"/> if this channel is open; otherwise, <see langword="false"/>.
225225
/// </value>
226226
public bool IsOpen { get; protected set; }
227227

@@ -264,7 +264,7 @@ private set
264264
/// Gets a value indicating whether the session is connected.
265265
/// </summary>
266266
/// <value>
267-
/// <c>true</c> if the session is connected; otherwise, <c>false</c>.
267+
/// <see langword="true"/> if the session is connected; otherwise, <see langword="false"/>.
268268
/// </value>
269269
protected bool IsConnected
270270
{
@@ -459,11 +459,11 @@ private void RaiseExceptionEvent(Exception exception)
459459
/// </summary>
460460
/// <param name="message">The message to send.</param>
461461
/// <returns>
462-
/// <c>true</c> if the message was sent to the server; otherwise, <c>false</c>.
462+
/// <see langword="true"/> if the message was sent to the server; otherwise, <see langword="false"/>.
463463
/// </returns>
464464
/// <exception cref="InvalidOperationException">The size of the packet exceeds the maximum size defined by the protocol.</exception>
465465
/// <remarks>
466-
/// This methods returns <c>false</c> when the attempt to send the message results in a
466+
/// This methods returns <see langword="false"/> when the attempt to send the message results in a
467467
/// <see cref="SocketException"/> or a <see cref="SshException"/>.
468468
/// </remarks>
469469
private bool TrySendMessage(Message message)
@@ -824,7 +824,7 @@ public void Dispose()
824824
/// <summary>
825825
/// Releases unmanaged and - optionally - managed resources.
826826
/// </summary>
827-
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
827+
/// <param name="disposing"><see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release only unmanaged resources.</param>
828828
protected virtual void Dispose(bool disposing)
829829
{
830830
if (!_isDisposed && disposing)

src/Renci.SshNet/Channels/ChannelSession.cs

+17-17
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ protected override void Close()
129129
/// <param name="height">The height.</param>
130130
/// <param name="terminalModeValues">The terminal mode values.</param>
131131
/// <returns>
132-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
132+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
133133
/// </returns>
134134
public bool SendPseudoTerminalRequest(string environmentVariable, uint columns, uint rows, uint width, uint height, IDictionary<TerminalModes, uint> terminalModeValues)
135135
{
@@ -142,12 +142,12 @@ public bool SendPseudoTerminalRequest(string environmentVariable, uint columns,
142142
/// <summary>
143143
/// Sends the X11 forwarding request.
144144
/// </summary>
145-
/// <param name="isSingleConnection">if set to <c>true</c> the it is single connection.</param>
145+
/// <param name="isSingleConnection">if set to <see langword="true"/> the it is single connection.</param>
146146
/// <param name="protocol">The protocol.</param>
147147
/// <param name="cookie">The cookie.</param>
148148
/// <param name="screenNumber">The screen number.</param>
149149
/// <returns>
150-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
150+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
151151
/// </returns>
152152
public bool SendX11ForwardingRequest(bool isSingleConnection, string protocol, byte[] cookie, uint screenNumber)
153153
{
@@ -163,7 +163,7 @@ public bool SendX11ForwardingRequest(bool isSingleConnection, string protocol, b
163163
/// <param name="variableName">Name of the variable.</param>
164164
/// <param name="variableValue">The variable value.</param>
165165
/// <returns>
166-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
166+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
167167
/// </returns>
168168
public bool SendEnvironmentVariableRequest(string variableName, string variableValue)
169169
{
@@ -177,7 +177,7 @@ public bool SendEnvironmentVariableRequest(string variableName, string variableV
177177
/// Sends the shell request.
178178
/// </summary>
179179
/// <returns>
180-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
180+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
181181
/// </returns>
182182
public bool SendShellRequest()
183183
{
@@ -192,7 +192,7 @@ public bool SendShellRequest()
192192
/// </summary>
193193
/// <param name="command">The command.</param>
194194
/// <returns>
195-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
195+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
196196
/// </returns>
197197
public bool SendExecRequest(string command)
198198
{
@@ -207,7 +207,7 @@ public bool SendExecRequest(string command)
207207
/// </summary>
208208
/// <param name="breakLength">Length of the break.</param>
209209
/// <returns>
210-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
210+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
211211
/// </returns>
212212
public bool SendBreakRequest(uint breakLength)
213213
{
@@ -222,7 +222,7 @@ public bool SendBreakRequest(uint breakLength)
222222
/// </summary>
223223
/// <param name="subsystem">The subsystem.</param>
224224
/// <returns>
225-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
225+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
226226
/// </returns>
227227
public bool SendSubsystemRequest(string subsystem)
228228
{
@@ -240,7 +240,7 @@ public bool SendSubsystemRequest(string subsystem)
240240
/// <param name="width">The width.</param>
241241
/// <param name="height">The height.</param>
242242
/// <returns>
243-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
243+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
244244
/// </returns>
245245
public bool SendWindowChangeRequest(uint columns, uint rows, uint width, uint height)
246246
{
@@ -251,9 +251,9 @@ public bool SendWindowChangeRequest(uint columns, uint rows, uint width, uint he
251251
/// <summary>
252252
/// Sends the local flow request.
253253
/// </summary>
254-
/// <param name="clientCanDo">if set to <c>true</c> [client can do].</param>
254+
/// <param name="clientCanDo">if set to <see langword="true"/> [client can do].</param>
255255
/// <returns>
256-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
256+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
257257
/// </returns>
258258
public bool SendLocalFlowRequest(bool clientCanDo)
259259
{
@@ -266,7 +266,7 @@ public bool SendLocalFlowRequest(bool clientCanDo)
266266
/// </summary>
267267
/// <param name="signalName">Name of the signal.</param>
268268
/// <returns>
269-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
269+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
270270
/// </returns>
271271
public bool SendSignalRequest(string signalName)
272272
{
@@ -279,7 +279,7 @@ public bool SendSignalRequest(string signalName)
279279
/// </summary>
280280
/// <param name="exitStatus">The exit status.</param>
281281
/// <returns>
282-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
282+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
283283
/// </returns>
284284
public bool SendExitStatusRequest(uint exitStatus)
285285
{
@@ -291,11 +291,11 @@ public bool SendExitStatusRequest(uint exitStatus)
291291
/// Sends the exit signal request.
292292
/// </summary>
293293
/// <param name="signalName">Name of the signal.</param>
294-
/// <param name="coreDumped">if set to <c>true</c> [core dumped].</param>
294+
/// <param name="coreDumped">if set to <see langword="true"/> [core dumped].</param>
295295
/// <param name="errorMessage">The error message.</param>
296296
/// <param name="language">The language.</param>
297297
/// <returns>
298-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
298+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
299299
/// </returns>
300300
public bool SendExitSignalRequest(string signalName, bool coreDumped, string errorMessage, string language)
301301
{
@@ -307,7 +307,7 @@ public bool SendExitSignalRequest(string signalName, bool coreDumped, string err
307307
/// Sends eow@openssh.com request.
308308
/// </summary>
309309
/// <returns>
310-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
310+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
311311
/// </returns>
312312
public bool SendEndOfWriteRequest()
313313
{
@@ -321,7 +321,7 @@ public bool SendEndOfWriteRequest()
321321
/// Sends keepalive@openssh.com request.
322322
/// </summary>
323323
/// <returns>
324-
/// <c>true</c> if request was successful; otherwise <c>false</c>.
324+
/// <see langword="true"/> if request was successful; otherwise <see langword="false"/>.
325325
/// </returns>
326326
public bool SendKeepAliveRequest()
327327
{

src/Renci.SshNet/Channels/ClientChannel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ protected override void Dispose(bool disposing)
113113
/// </summary>
114114
/// <param name="session">The session.</param>
115115
/// <remarks>
116-
/// Does nothing when <paramref name="session"/> is <c>null</c>.
116+
/// Does nothing when <paramref name="session"/> is <see langword="null"/>.
117117
/// </remarks>
118118
private void UnsubscribeFromSessionEvents(ISession session)
119119
{

0 commit comments

Comments
 (0)