Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA1200: Avoid using cref tags with a prefix #7194

Merged
merged 16 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Common.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ dotnet_diagnostic.CA1069.severity = none
dotnet_diagnostic.CA1070.severity = warning

# Avoid using cref tags with a prefix
dotnet_diagnostic.CA1200.severity = suggestion
dotnet_diagnostic.CA1200.severity = warning

# Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none
Expand Down
2 changes: 1 addition & 1 deletion src/Build/Collections/RetrievableEntryHashSet/HashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Microsoft.Build.Collections
{
/// <summary>
/// Implementation notes:
/// This uses an array-based implementation similar to <see cref="T:Dictionary{T}" />, using a buckets array
/// This uses an array-based implementation similar to <see cref="Dictionary{TKey, TValue}" />, using a buckets array
/// to map hash values to the Slots array. Items in the Slots array that hash to the same value
/// are chained together through the "next" indices.
///
Expand Down
2 changes: 1 addition & 1 deletion src/Build/Construction/ProjectElementContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void RemoveChild(ProjectElement child)
/// </summary>
/// <remarks>
/// It is safe to modify the children in this way
/// during enumeration. See <see cref="M:Microsoft.Build.Construction.ProjectElementContainer.RemoveChild(Microsoft.Build.Construction.ProjectElement)" />.
/// during enumeration. See <see cref="ProjectElementContainer.RemoveChild(ProjectElement)"/>.
/// </remarks>
public void RemoveAllChildren()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Build/Definition/ProjectCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public static ProjectCollection GlobalProjectCollection
/// This is the Windows file version (specifically the value of the FileVersion
/// resource), not necessarily the assembly version.
/// If you want the assembly version, use Constants.AssemblyVersion.
/// This is not the <see cref="P:Microsoft.Build.BuildEngine.ToolsetCollection.ToolsVersions*">ToolsetCollection.ToolsVersions</see>.
/// This is not a <see cref="Toolset"/>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the modern equivalent:

Suggested change
/// This is not a <see cref="Toolset"/>.
/// This is not the <see cref="Toolset.ToolsVersion"/>.

/// </remarks>
public static Version Version
{
Expand Down
4 changes: 2 additions & 2 deletions src/Build/Graph/ProjectGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public ProjectGraph(
/// on <see cref="ProjectInstanceFactoryFunc" /> for other scenarios.
/// </param>
/// <param name="cancellationToken">
/// The <see cref="T:System.Threading.CancellationToken" /> token to observe.
/// The <see cref="CancellationToken"/> to observe.
/// </param>
/// <exception cref="InvalidProjectFileException">
/// If the evaluation of any project in the graph fails
Expand Down Expand Up @@ -397,7 +397,7 @@ public ProjectGraph(
/// Number of threads to participate in building the project graph.
/// </param>
/// <param name="cancellationToken">
/// The <see cref="T:System.Threading.CancellationToken" /> token to observe.
/// The <see cref="CancellationToken"/> to observe.
/// </param>
/// <exception cref="InvalidProjectFileException">
/// If the evaluation of any project in the graph fails
Expand Down
9 changes: 5 additions & 4 deletions src/Build/Logging/BinaryLogger/BuildEventArgsReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public class BuildEventArgsReader : IDisposable
typeof(BuildEventArgs).GetField("senderName", BindingFlags.Instance | BindingFlags.NonPublic);

/// <summary>
/// Initializes a new instance of <see cref="T:Microsoft.Build.Logging.BuildEventArgsReader"/> using a <see cref="T:System.IO.BinaryReader"/> instance.
/// Initializes a new instance of <see cref="BuildEventArgsReader"/> using a <see cref="BinaryReader"/> instance.
/// </summary>
/// <param name="binaryReader">The <see cref="T:System.IO.BinaryReader"/> to read <see cref="T:Microsoft.Build.Framework.BuildEventArgs"/> from.</param>
/// <param name="binaryReader">The <see cref="BinaryReader"/> to read <see cref="BuildEventArgs"/> from.</param>
/// <param name="fileFormatVersion">The file format version of the log file being read.</param>
public BuildEventArgsReader(BinaryReader binaryReader, int fileFormatVersion)
{
Expand All @@ -81,10 +81,11 @@ public void Dispose()
internal event Action<BinaryLogRecordKind, byte[]> OnBlobRead;

/// <summary>
/// Reads the next log record from the <see cref="T:System.IO.BinaryReader"/>.
/// Reads the next log record from the <see cref="BinaryReader"/>.
/// </summary>
/// <returns>
/// The next <see cref="T:Microsoft.Build.Framework.BuildEventArgs" />. If there are no more records, returns <see langword="null" />.
/// The next <see cref="BuildEventArgs"/>.
/// If there are no more records, returns <see langword="null"/>.
/// </returns>
public BuildEventArgs Read()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected override bool ReleaseHandle()
internal class MemoryStatus
{
/// <summary>
/// Initializes a new instance of the <see cref="T:MemoryStatus"/> class.
/// Initializes a new instance of the <see cref="MemoryStatus"/> class.
/// </summary>
public MemoryStatus()
{
Expand Down
17 changes: 7 additions & 10 deletions src/Framework/Sdk/SdkResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ public abstract class SdkResolver
/// <param name="resolverContext">Context for resolving the SDK.</param>
/// <param name="factory">Factory class to create an <see cref="SdkResult" /></param>
/// <returns>
/// An <see cref="SdkResult" /> containing the resolved SDKs or associated error / reason
/// the SDK could not be resolved. Return <code>null</code> if the resolver is not
/// applicable for a particular <see cref="SdkReference"/>.
/// </returns>
/// <remarks><format type="text/markdown"><![CDATA[
/// ## Remarks
/// > [!NOTE]
/// > You must use the <xref:Microsoft.Build.Framework.SdkResultFactory> to return a result.
/// ]]></format>
/// </remarks>
/// An <see cref="SdkResult" /> containing the resolved SDKs or associated error / reason
/// the SDK could not be resolved. Return <see langword="null"/> if the resolver is not
/// applicable for a particular <see cref="SdkReference"/>.
/// </returns>
/// <remarks>
/// Note: You must use <see cref="SdkResultFactory"/> to return a result.
/// </remarks>
///
public abstract SdkResult Resolve(SdkReference sdkReference,
SdkResolverContext resolverContext,
Expand Down
10 changes: 5 additions & 5 deletions src/MSBuildTaskHost/Concurrent/ConcurrentDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ private static void ThrowKeyNullException()
/// if the key does not already exist.
/// </summary>
/// <param name="key">The key of the element to add.</param>
/// <param name="valueFactory">The function used to generate a value for the key</param>
/// <exception cref="T:System.ArgumentNullException"><paramref name="key"/> is a null reference
/// <param name="valueFactory">The function used to generate a value for the key.</param>
/// <exception cref="ArgumentNullException"><paramref name="key"/> is a null reference
/// (Nothing in Visual Basic).</exception>
/// <exception cref="T:System.ArgumentNullException"><paramref name="valueFactory"/> is a null reference
/// <exception cref="ArgumentNullException"><paramref name="valueFactory"/> is a null reference
/// (Nothing in Visual Basic).</exception>
/// <exception cref="T:System.OverflowException">The dictionary contains too many
/// <exception cref="OverflowException">The dictionary contains too many
/// elements.</exception>
/// <returns>The value for the key. This will be either the existing value for the key if the
/// <returns>The value for the key. This will be either the existing value for the key if the
/// key is already in the dictionary, or the new value for the key as returned by valueFactory
/// if the key was not in the dictionary.</returns>
public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
Expand Down
7 changes: 2 additions & 5 deletions src/Tasks/Hash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ namespace Microsoft.Build.Tasks
/// Generates a hash of a given ItemGroup items. Metadata is not considered in the hash.
/// </summary>
/// <remarks>
/// <format type="text/markdown"><![CDATA[
/// ## Remarks
/// Currently uses SHA1. The implementation is subject to change between MSBuild versions.
/// This class is not intended as a cryptographic security measure, only for uniqueness between build executions.
/// ]]></format>
/// Currently uses SHA1. Implementation subject to change between MSBuild versions.
/// This class is not intended as a cryptographic security measure, only uniqueness between build executions.
/// </remarks>
public class Hash : TaskExtension
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/RoslynCodeTaskFactory/RoslynCodeTaskFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public sealed class RoslynCodeTaskFactory : ITaskFactory
public string FactoryName => "Roslyn Code Task Factory";

/// <summary>
/// Gets the <see cref="T:System.Type" /> of the compiled task.
/// Gets the <see cref="Type"/> of the compiled task.
/// </summary>
public Type TaskType { get; private set; }

Expand Down