Add DocumentationAnalyzers from NuGet and fix syntax in docs

This commit is contained in:
YoshiRulz 2021-07-27 14:53:04 +10:00
parent 8d210df9e3
commit 99260d2746
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
19 changed files with 86 additions and 41 deletions

View File

@ -1,5 +1,58 @@
<?xml version="1.0"?>
<RuleSet Name="BizHawk Rules" Description="Applies to all projects in the solution -- or, it will eventually." ToolsVersion="14.0">
<Rules AnalyzerId="DocumentationAnalyzers" RuleNamespace="DocumentationAnalyzers.StyleRules">
<!-- Place text in paragraphs -->
<Rule Id="DOC100" Action="Hidden" />
<!-- Use child blocks consistently -->
<Rule Id="DOC101" Action="Hidden" />
<!-- Use child blocks consistently across elements of the same kind -->
<Rule Id="DOC102" Action="Hidden" />
<!-- Use Unicode characters -->
<!-- unnecessary HTML entities also get picked up by CS1570, which seems more reliable -->
<Rule Id="DOC103" Action="Error" />
<!-- Prefer '<see langword="keyword"/>' to '<c>keyword</c>' for referencing language keywords -->
<Rule Id="DOC104" Action="Warning" />
<!-- Prefer '<paramref name="parameter"/>' to '<c>parameter</c>' for referencing parameters -->
<Rule Id="DOC105" Action="Warning" />
<!-- Prefer '<typeparamref name="type_parameter"/>' to '<c>type_parameter</c>' for referencing type parameters -->
<Rule Id="DOC106" Action="Warning" />
<!-- Prefer '<see cref="target"/>' to '<c>target</c>' for referencing code elements -->
<Rule Id="DOC107" Action="Warning" />
<!-- Avoid empty paragraphs -->
<Rule Id="DOC108" Action="Error" />
</Rules>
<Rules AnalyzerId="DocumentationAnalyzers" RuleNamespace="DocumentationAnalyzers.PortabilityRules">
<!-- Use XML documentation syntax -->
<Rule Id="DOC200" Action="Error" />
<!-- Item should have description -->
<Rule Id="DOC201" Action="Error" />
<!-- Use section elements correctly -->
<Rule Id="DOC202" Action="Error" />
<!-- Use block elements correctly -->
<Rule Id="DOC203" Action="Error" />
<!-- Use inline elements correctly -->
<!-- but this doesn't pick up <seealso/> in <summary/>, for example... -->
<Rule Id="DOC204" Action="Error" />
<!-- 'langword' attribute value should be a language keyword -->
<Rule Id="DOC207" Action="Error" />
<!-- 'href' attribute value should be a URI -->
<!-- a lot of false negatives with this one too -->
<Rule Id="DOC209" Action="Error" />
</Rules>
<Rules AnalyzerId="Menees.Analyzers" RuleNamespace="Menees.Analyzers">
<!-- Line is too long -->
<Rule Id="MEN002" Action="Hidden" />

View File

@ -12,7 +12,7 @@ namespace BizHawk.Client.Common
public static string TasMovieExtension => TasMovie.Extension;
/// <summary>
/// Gets a list of extensions for all <seealso cref="IMovie"/> implementations
/// Gets a list of extensions for all <see cref="IMovie"/> implementations
/// </summary>
public static IEnumerable<string> MovieExtensions => new[] { Bk2Movie.Extension, TasMovie.Extension };

View File

@ -54,7 +54,7 @@
FixedPoint_16_16,
/// <summary>
/// The traditional float type as in C++ <seealso cref="float"/>
/// The traditional float type as in C++ <see langword="float"/>
/// Used only by <see cref="DWordWatch"/> as it is 32 bits length
/// </summary>
Float

View File

@ -3,7 +3,7 @@
namespace BizHawk.Client.EmuHawk
{
/// <summary>
/// Represents a single cell of the <seealso cref="InputRoll"/>
/// Represents a single cell of the <see cref="InputRoll"/>
/// </summary>
public class Cell
{

View File

@ -821,10 +821,10 @@ namespace BizHawk.Client.EmuHawk
/// <list type="bullet">
/// <item><description>Saving a no-framebuffer state that is stored in RAM</description></item>
/// <item><description>Emulating forth for some frames with updates disabled</description></item>
/// <item><list type="bullet">
/// <item><description><list type="bullet">
/// <item><description>Optionally hacking in-game memory
/// (like camera position, to show off-screen areas)</description></item>
/// </list></item>
/// </list></description></item>
/// <item><description>Updating the screen</description></item>
/// <item><description>Loading the no-framebuffer state from RAM</description></item>
/// </list>
@ -3232,7 +3232,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// start AVI recording, unattended
/// </summary>
/// <param name="videoWriterName">match the short name of an <seealso cref="IVideoWriter"/></param>
/// <param name="videoWriterName">match the short name of an <see cref="IVideoWriter"/></param>
/// <param name="filename">filename to save to</param>
private void RecordAv(string videoWriterName, string filename)
{

View File

@ -10,6 +10,7 @@
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
<PackageReference Include="Menees.Analyzers" Version="2.0.4" Condition=" '$(MachineRunAnalyzersDuringBuild)' != '' " />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333" Condition=" '$(MachineRunAnalyzersDuringBuild)' != '' " />
<ProjectReference Include="$(ProjectDir)../BizHawk.Version/BizHawk.Version.csproj" ReferenceOutputAssembly="false" /><!-- generates VersionInfo.gen.cs -->

View File

@ -7,16 +7,12 @@ using System.Linq;
namespace BizHawk.Emulation.Common
{
/// <summary>
/// An implementation of <seealso cref="ITraceable"/> that is implementation using only methods
/// from <seealso cref="IDebuggable"/>, <seealso cref="IMemoryDomains"/>, and <seealso cref="IDisassemblable"/>
/// An implementation of <see cref="ITraceable"/> that is implementation using only methods
/// from <see cref="IDebuggable"/>, <see cref="IMemoryDomains"/>, and <see cref="IDisassemblable"/>
/// Useful for ported cores that have these hooks but no trace logging hook,
/// This allows for a traceable implementation without the need for additional API
/// Note that this technique will always be significantly slower than a direct implementation
/// </summary>
/// <seealso cref="ITraceable"/>
/// <seealso cref="IDebuggable"/>
/// <seealso cref="IMemoryDomains"/>
/// <seealso cref="IDisassemblable"/>
public abstract class CallbackBasedTraceBuffer : ITraceable
{
/// <exception cref="InvalidOperationException"><paramref name="debuggableCore"/> does not provide memory callback support or does not implement <see cref="IDebuggable.GetCpuFlagsAndRegisters"/></exception>

View File

@ -7,13 +7,11 @@ using System.Collections.Generic;
namespace BizHawk.Emulation.Common
{
/// <summary>
/// An implementation of <seealso cref="IInputCallbackSystem"/> that is implementation using only methods
/// from <seealso cref="IDebuggable"/>,
/// An implementation of <see cref="IInputCallbackSystem"/> that is implementation using only methods
/// from <see cref="IDebuggable"/>,
/// Useful for ported cores that have these hooks but no input callback hook,
/// This allows for an input callback implementation without the need for additional APIs
/// </summary>
/// <seealso cref="IInputCallbackSystem"/>
/// <seealso cref="IDebuggable"/>
public class MemoryBasedInputCallbackSystem : IInputCallbackSystem
{
private readonly List<Action> _inputCallbacks = new List<Action>();

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Common
/// <summary>
/// This object facilitates communications between client and core
/// The primary use is to provide a client => core communication, such as providing client-side callbacks for a core to use
/// Any communications that can be described as purely a Core -> Client system, should be provided as an <seealso cref="IEmulatorService"/> instead
/// Any communications that can be described as purely a Core -> Client system, should be provided as an <see cref="IEmulatorService"/> instead
/// It is important that by design this class stay immutable
/// </summary>
public class CoreComm

View File

@ -1,7 +1,7 @@
namespace BizHawk.Emulation.Common
{
/// <summary>
/// DisplayType, used in <seealso cref="IEmulator"/>
/// DisplayType, used in <see cref="IEmulator"/>
/// </summary>
public enum DisplayType
{
@ -11,7 +11,7 @@
}
/// <summary>
/// The type/increment of stepping in the Step method of <seealso cref="IDebuggable"/>
/// The type/increment of stepping in the Step method of <see cref="IDebuggable"/>
/// </summary>
public enum StepType
{

View File

@ -30,12 +30,13 @@ namespace BizHawk.Emulation.Common
/// Runs the emulator core for 1 frame
/// note that (some?) cores expect you to call SoundProvider.GetSamples() after each FrameAdvance()
/// please do this, even when <paramref name="renderSound"/> = false
/// <param name="controller">The <seealso cref="IController"/> instance that the core will use for input.
/// The <seealso cref="IController"/> provided by the client must provide the buttons specified by the core through the <seealso cref="ControllerDefinition"/> property
/// </summary>
/// <param name="controller">
/// The <see cref="IController"/> instance that the core will use for input.
/// The <see cref="IController"/> provided by the client must provide the buttons specified by the core through the <see cref="ControllerDefinition"/> property
/// </param>
/// <param name="render">Whether or not to render video, cores will pass false here in cases such as frame skipping</param>
/// <param name="renderSound">Whether or not to render audio, cores will pass here false here in cases such as fast forwarding where bypassing sound may improve speed</param>
/// </summary>
bool FrameAdvance(IController controller, bool render, bool renderSound = true);
/// <summary>

View File

@ -1,7 +1,7 @@
namespace BizHawk.Emulation.Common
{
/// <summary>
/// This interface specifies that an interface or implementation is a emulator core service, such as <seealso cref="IDebuggable"/>,
/// This interface specifies that an interface or implementation is a emulator core service, such as <see cref="IDebuggable"/>,
/// but is an optional part of the core functionality
/// Clients should gracefully handle an IEmulator that has a missing or partial implementation of one of these services
/// </summary>

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace BizHawk.Emulation.Common
{
/// <summary>
/// This interface defines the mechanism by which clients can retrieve <seealso cref="IEmulatorService" />
/// This interface defines the mechanism by which clients can retrieve <see cref="IEmulatorService"/>
/// from an IEmulator implementation
/// An implementation should collect all available IEmulatorService instances.
/// This interface defines only the client interaction. This interface does not specify the means
@ -14,13 +14,12 @@ namespace BizHawk.Emulation.Common
/// by design must provide this mechanism
/// </summary>
/// <seealso cref="IEmulator" />
/// <seealso cref="IEmulatorService"/>
public interface IEmulatorServiceProvider
{
/// <summary>
/// Returns whether or not T is available
/// </summary>
/// <typeparam name="T">The <seealso cref="IEmulatorService" /> to check</typeparam>
/// <typeparam name="T">The <see cref="IEmulatorService"/> to check</typeparam>
bool HasService<T>() where T : IEmulatorService;
/// <summary>
@ -32,7 +31,7 @@ namespace BizHawk.Emulation.Common
/// Returns an instance of T if T is available
/// Else returns null
/// </summary>
/// <typeparam name="T">The requested <seealso cref="IEmulatorService" /></typeparam>
/// <typeparam name="T">The requested <see cref="IEmulatorService"/></typeparam>
T GetService<T>() where T : IEmulatorService;
/// <summary>

View File

@ -6,11 +6,10 @@ using System.Collections.Generic;
namespace BizHawk.Emulation.Common
{
/// <summary>
/// This is a property of <seealso cref="IInputPollable"/>, and defines the means by which a client
/// This is a property of <see cref="IInputPollable"/>, and defines the means by which a client
/// gets and sets input callbacks in the core. An input callback should fire any time input is
/// polled by the core
/// </summary>
/// <seealso cref="IInputPollable"/>
public interface IInputCallbackSystem : ICollection<Action>
{
/// <summary>

View File

@ -9,11 +9,10 @@ namespace BizHawk.Emulation.Common
public delegate void MemoryCallbackDelegate(uint address, uint value, uint flags);
/// <summary>
/// This is a property of <seealso cref="IDebuggable"/>, and defines the means by which a client
/// This is a property of <see cref="IDebuggable"/>, and defines the means by which a client
/// gets and sets memory callbacks in the core. A memory callback should fire any time memory is
/// read/written/executed by the core, and depends on the type specified by the callback
/// </summary>
/// <seealso cref="IDebuggable"/>
public interface IMemoryCallbackSystem : IEnumerable<IMemoryCallback>
{
/*
@ -91,7 +90,7 @@ namespace BizHawk.Emulation.Common
/// <summary>
/// A list of available "scopes" (memory domains, cpus, etc) that a the <see cref="IMemoryCallback.Scope"/> property of the <see cref="IMemoryCallback"/> can have
/// Passing a <see cref="IMemoryCallback"/> into the <see cref="Add(IMemoryCallback)"/> method that is not in this list will result in an <seealso cref="InvalidOperationException"/>
/// Passing a <see cref="IMemoryCallback"/> into the <see cref="Add(IMemoryCallback)"/> method that is not in this list will result in an <see cref="InvalidOperationException"/>
/// </summary>
string[] AvailableScopes { get; }
}

View File

@ -1,11 +1,10 @@
namespace BizHawk.Emulation.Common
{
/// <summary>
/// An <seealso cref="IEmulatorService"/> that returns cart/mapper/board information about the Game hardware itself, if available
/// An <see cref="IEmulatorService"/> that returns cart/mapper/board information about the Game hardware itself, if available
/// Currently the board name is the only property but this could be expanded to support more detailed information
/// </summary>
/// <seealso cref="IEmulator"/>
/// <seealso cref="IEmulatorService"/>
public interface IBoardInfo : IEmulatorService
{
/// <summary>

View File

@ -9,13 +9,13 @@ namespace BizHawk.Emulation.Common
/// <summary>
/// This service provides the means to generate disassembly by the core for a given CPU and memory domain
/// Tools such the debugger use this, but also LUA scripting, and tools like trace logging and code data logging can make use of this tool
/// If unavailable the debugger tool will still be available but disable the disassembly window but still be available if the <seealso cref="IDebuggable"/> service is available
/// If unavailable the debugger tool will still be available but disable the disassembly window but still be available if the <see cref="IDebuggable"/> service is available
/// </summary>
public interface IDisassemblable : IEmulatorService
{
/// <summary>
/// Gets or sets the CPUS that will be used to disassemble
/// Only values returned from <seealso cref="AvailableCpus"/> will be supported when Set
/// Only values returned from <see cref="AvailableCpus"/> will be supported when Set
/// </summary>
string Cpu { get; set; }

View File

@ -21,7 +21,7 @@ namespace BizHawk.Emulation.Common
// 2. aspect ratio is accurate
/// <summary>
/// Gets a value that together with <seealso cref="VirtualHeight"/>, describes a metric on the screen
/// Gets a value that together with <see cref="VirtualHeight"/>, describes a metric on the screen
/// they should define the smallest size that the buffer can be placed inside such that:
/// 1. no actual pixel data is lost
/// 2. aspect ratio is accurate
@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Common
int VirtualWidth { get; }
/// <summary>
/// Gets a value that together with <seealso cref="VirtualWidth"/>, describes a metric on the screen
/// Gets a value that together with <see cref="VirtualWidth"/>, describes a metric on the screen
/// they should define the smallest size that the buffer can be placed inside such that:
/// 1. no actual pixel data is lost
/// 2. aspect ratio is accurate
@ -47,12 +47,12 @@ namespace BizHawk.Emulation.Common
int BufferHeight { get; }
/// <summary>
/// Gets the vsync Numerator. Combined with the <seealso cref="VsyncDenominator"/> can be used to calculate a precise vsync rate.
/// Gets the vsync Numerator. Combined with the <see cref="VsyncDenominator"/> can be used to calculate a precise vsync rate.
/// </summary>
int VsyncNumerator { get; }
/// <summary>
/// Gets the vsync Denominator. Combined with the <seealso cref="VsyncNumerator"/> can be used to calculate a precise vsync rate.
/// Gets the vsync Denominator. Combined with the <see cref="VsyncNumerator"/> can be used to calculate a precise vsync rate.
/// </summary>
int VsyncDenominator { get; }

View File

@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Common
/// <param name="ratioden">denominator of sample rate change ratio (inrate / outrate)</param>
/// <param name="sratein">sampling rate in, rounded to nearest hz</param>
/// <param name="srateout">sampling rate out, rounded to nearest hz</param>
/// <param name="drainer">function which accepts output as produced. if null, act as an <seealso cref="ISoundProvider"/></param>
/// <param name="drainer">function which accepts output as produced. if null, act as an <see cref="ISoundProvider"/></param>
/// <param name="input">source to take input from when output is requested. if null, no auto-fetching</param>
/// <exception cref="ArgumentException"><paramref name="drainer"/> and <paramref name="input"/> are both non-null</exception>
/// <exception cref="Exception">unmanaged call failed</exception>