]> git.deb.at Git - rhonda/impostor.git/commitdiff
Fix xmldoc warnings
authorjs6pak <kubastaron@hotmail.com>
Wed, 24 Mar 2021 16:55:15 +0000 (17:55 +0100)
committerjs6pak <kubastaron@hotmail.com>
Wed, 24 Mar 2021 16:55:15 +0000 (17:55 +0100)
16 files changed:
src/Directory.Build.props
src/Impostor.Api/Events/Attributes/EventListenerAttribute.cs
src/Impostor.Api/Events/Game/Player/IPlayerStartMeetingEvent.cs
src/Impostor.Api/Events/IEventCancelable.cs
src/Impostor.Api/Events/Managers/IEventManager.cs
src/Impostor.Api/Extensions/SpanReaderExtensions.cs
src/Impostor.Api/Impostor.Api.csproj
src/Impostor.Api/Net/IClient.cs
src/Impostor.Api/Net/IHazelConnection.cs
src/Impostor.Api/Net/Messages/IMessageWriterProvider.cs
src/Impostor.Api/Reactor/PluginSide.cs
src/Impostor.Server/Extensions/TypeExtensions.cs
src/Impostor.Server/Impostor.Server.csproj
src/Impostor.Server/Recorder/ServerReplayVersion.cs
src/ProjectRules.ruleset
src/stylecop.json [new file with mode: 0644]

index 81faf42b80ecc57ca3a8c3d9899ac72be29c381d..1bcb40ab45e83a64df9291c885a70208e656bc01 100644 (file)
@@ -3,5 +3,9 @@
     <VersionPrefix>1.3.0</VersionPrefix>
     <VersionSuffix>dev</VersionSuffix>
   </PropertyGroup>
+
+  <ItemGroup>
+    <AdditionalFiles Include="$(SolutionDir)stylecop.json" />
+  </ItemGroup>
 </Project>
   
index 9289fa5f8ec6591f80cf2e088068fbc9d2f1f151..da1e48960c87ab9039e46e505dd5730863a4f4d8 100644 (file)
@@ -17,17 +17,17 @@ namespace Impostor.Api.Events
         }
 
         /// <summary>
-        ///     The priority of the event listener.
+        ///     Gets or sets the priority of the event listener.
         /// </summary>
         public EventPriority Priority { get; set; }
 
         /// <summary>
-        ///     The events that the listener is listening to.
+        ///     Gets or sets the event that the listener is listening to.
         /// </summary>
         public Type? Event { get; set; }
 
         /// <summary>
-        ///     If set to true, the listener will be called regardless of the <see cref="IEventCancelable.IsCancelled" />.
+        ///     Gets or sets a value indicating whether the listener will be called regardless of the <see cref="IEventCancelable.IsCancelled" />.
         /// </summary>
         public bool IgnoreCancelled { get; set; }
     }
index 1a28115eb133643dd31a3c78be5ba4ad27bf4bec..016d131d2d4900ec4e5074fc4a995d86c751f90d 100644 (file)
@@ -5,7 +5,7 @@ namespace Impostor.Api.Events.Player
     public interface IPlayerStartMeetingEvent : IPlayerEvent
     {
         /// <summary>
-        ///     Gets the player who's body got reported. Is null when the meeting started by Emergency call button
+        ///     Gets the player who's body got reported. Is null when the meeting started by Emergency call button.
         /// </summary>
         IInnerPlayerControl? Body { get; }
     }
index d6d1ca6699cc5d2181f4c12167287cc6455b2f52..1902284ee97947ea402fb2847cbd7cb3234cbcf8 100644 (file)
@@ -3,7 +3,7 @@
     public interface IEventCancelable : IEvent
     {
         /// <summary>
-        ///     True if the event was cancelled.
+        ///     Gets or sets a value indicating whether the event was cancelled.
         /// </summary>
         bool IsCancelled { get; set; }
     }
index 35fb9bbcc292fa991cbc59d7cbaceadc5e672c65..3d73768a1bc132ef1f6f87be33166440051bd762 100644 (file)
@@ -16,15 +16,15 @@ namespace Impostor.Api.Events.Managers
             where TListener : IEventListener;
 
         /// <summary>
-        ///     Returns true if an event with the type <see cref="TEvent" /> is registered.
+        ///     Returns true if an event with the type <typeparamref name="TEvent" /> is registered.
         /// </summary>
-        /// <returns>True if the <see cref="TEvent" /> is registered.</returns>
+        /// <returns>True if the <typeparamref name="TEvent" /> is registered.</returns>
         /// <typeparam name="TEvent">Type of the event.</typeparam>
         bool IsRegistered<TEvent>()
             where TEvent : IEvent;
 
         /// <summary>
-        ///     Call all the event listeners for the type <see cref="TEvent" />.
+        ///     Call all the event listeners for the type <typeparamref name="TEvent" />.
         /// </summary>
         /// <param name="event">The event argument.</param>
         /// <typeparam name="TEvent">Type of the event.</typeparam>
index 242f0549673344c5cd037ad6c39821cfa7287eb5..78e5a456796128ee887e611ec12290e1581d93e1 100644 (file)
@@ -5,7 +5,7 @@ using System.Runtime.CompilerServices;
 namespace Impostor.Api
 {
     /// <summary>
-    ///     Priovides a StreamReader-like api throught extensions
+    ///     Priovides a StreamReader-like api throught extensions.
     /// </summary>
     public static class SpanReaderExtensions
     {
@@ -53,11 +53,11 @@ namespace Impostor.Api
         }
 
         /// <summary>
-        ///     Advances the position of <see cref="input" /> by the size of <see cref="T" />.
+        ///     Advances the position of <paramref name="input" /> by the size of <typeparamref name="T" />.
         /// </summary>
         /// <typeparam name="T">Type that will be read.</typeparam>
         /// <param name="input">input "stream"/span.</param>
-        /// <returns>The original input</returns>
+        /// <returns>The original input.</returns>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static unsafe ReadOnlySpan<byte> Advance<T>(ref ReadOnlySpan<byte> input)
             where T : unmanaged
index 33c2ea01e6f1a83d7ffbddef895161dc4b8147d6..86b4f09d94f512e6f21b7e7391379ba27989fee2 100644 (file)
@@ -18,6 +18,7 @@
     <PackageProjectUrl>https://github.com/Impostor/Impostor</PackageProjectUrl>
     <RepositoryType>git</RepositoryType>
     <RepositoryUrl>https://github.com/Impostor/Impostor</RepositoryUrl>
+    <GenerateDocumentationFile>true</GenerateDocumentationFile>
   </PropertyGroup>
 
   <ItemGroup>
index 790b1c0b8f11c1bd7714d1493abae0242d3bfe5b..d9631d7d6c74bbb30403ea0b6de95567f3a07107 100644 (file)
@@ -57,7 +57,7 @@ namespace Impostor.Api.Net
         IDictionary<object, object> Items { get; }
 
         /// <summary>
-        ///     Gets or sets the current game data of the <see cref="IClient" />.
+        ///     Gets the current game data of the <see cref="IClient" />.
         /// </summary>
         IClientPlayer? Player { get; }
 
@@ -74,7 +74,7 @@ namespace Impostor.Api.Net
         ///     The message to show to the player.
         /// </param>
         /// <param name="message">
-        ///     Only used when <see cref="reason" /> is set to <see cref="DisconnectReason.Custom" />.
+        ///     Only used when <paramref name="reason" /> is set to <see cref="DisconnectReason.Custom" />.
         /// </param>
         /// <returns>
         ///     A <see cref="ValueTask" /> representing the asynchronous operation.
index c012bd1921bad6b6d7d30cf0ff9ccd9be5fcf463..e2a9cfbf9abecf54abeba544584479b8b48e0d68 100644 (file)
@@ -20,7 +20,7 @@ namespace Impostor.Api.Net
         bool IsConnected { get; }
 
         /// <summary>
-        ///     Gets the client of the connection.
+        ///     Gets or sets the client of the connection.
         /// </summary>
         IClient? Client { get; set; }
 
@@ -28,14 +28,14 @@ namespace Impostor.Api.Net
         ///     Sends a message writer to the connection.
         /// </summary>
         /// <param name="writer">The message.</param>
-        /// <returns></returns>
+        /// <returns>Task that must be awaited.</returns>
         ValueTask SendAsync(IMessageWriter writer);
 
         /// <summary>
         ///     Disconnects the client and invokes the disconnect handler.
         /// </summary>
         /// <param name="reason">A reason.</param>
-        /// <returns></returns>
+        /// <returns>Task that must be awaited.</returns>
         ValueTask DisconnectAsync(string? reason);
     }
 }
index cf920042683e9b0b3dceea70631ca7dffd763d27..16a48ecf8b0e7a64589affb0fd66aacb92dd3087 100644 (file)
@@ -4,7 +4,7 @@
     {
         /// <summary>
         ///     Retrieves a <see cref="IMessageWriter" /> from the internal pool.
-        ///     Make sure to call <see cref="IMessageWriter.Dispose" /> when you are done!
+        ///     Make sure to call <see cref="System.IDisposable.Dispose" /> when you are done!.
         /// </summary>
         /// <param name="sendOption">
         ///     Whether to send the message as <see cref="MessageType.Reliable" /> or <see cref="MessageType.Unreliable" />.
index 2118299bff845f32749290894a5f9f878d59f503..4523dfc6236abdead6ad44b7d262ebb9dae29a37 100644 (file)
@@ -1,7 +1,7 @@
 namespace Impostor.Api.Reactor
 {
     /// <summary>
-    ///     Plugin side used in modded handshake
+    ///     Plugin side used in modded handshake.
     /// </summary>
     public enum PluginSide : byte
     {
index 396d987f17c9cc3c6e3c452f0d122c4794fcc347..a49cb5e2bdee544cf544569c29db1d808182b47d 100644 (file)
@@ -45,7 +45,7 @@ namespace Impostor.Server
         /// </summary>
         /// <param name="method">The method.</param>
         /// <param name="showParameters">True if the parameters should be included in the name.</param>
-        /// <returns>Friendly name of the method</returns>
+        /// <returns>Friendly name of the method.</returns>
         public static string GetFriendlyName(this MethodBase method, bool showParameters = true)
         {
             var str = method.Name;
index 5cad72de69f6edf5767252c06e7caf6a7e80cede..ba444fc81198fba93280fee3765560942906818a 100644 (file)
@@ -9,6 +9,7 @@
     <CodeAnalysisRuleSet>../ProjectRules.ruleset</CodeAnalysisRuleSet>
     <Nullable>enable</Nullable>
     <SelfContained>false</SelfContained>
+    <GenerateDocumentationFile>true</GenerateDocumentationFile>
   </PropertyGroup>
 
   <PropertyGroup>
index 2eb3b49d0e603fa9bc06881920c325f0b5f399ab..ce77e3c7dd8931665eacaa7d5791faa85b764222 100644 (file)
@@ -6,12 +6,12 @@ namespace Impostor.Server.Recorder
     public enum ServerReplayVersion
     {
         /// <summary>
-        ///     Initial version
+        ///     Initial version.
         /// </summary>
         Initial = 1,
 
         /// <summary>
-        ///     Latest version
+        ///     Latest version.
         /// </summary>
         Latest = Initial,
     }
index 5102b80bf214405644fb50238434cc927a70c02e..5484352e8d37661278c8ed4e71ad6087f4c1b6e4 100644 (file)
@@ -1,6 +1,6 @@
 <RuleSet Name="Impostor" ToolsVersion="10.0">
-  <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.OrderingRules">
-    <Rule Id="SA1200" Action="None" />
+  <Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
+    <Rule Id="CS1591" Action="Hidden" />
   </Rules>
   <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.DocumentationRules">
     <Rule Id="SA1600" Action="None" />
@@ -17,7 +17,6 @@
     <Rule Id="SA1309" Action="None" />
   </Rules>
   <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.CSharp.SpacingRules">
-    <Rule Id="SA1003" Action="None" />
     <Rule Id="SA1009" Action="None" />
   </Rules>
 </RuleSet>
diff --git a/src/stylecop.json b/src/stylecop.json
new file mode 100644 (file)
index 0000000..216b35a
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
+  "settings": {
+    "orderingRules": {
+      "usingDirectivesPlacement": "preserve"
+    },
+    "layoutRules": {
+      "newlineAtEndOfFile": "require"
+    }
+  }
+}