Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -981,7 +981,7 @@ dotnet_diagnostic.SA1502.severity = suggestion
dotnet_diagnostic.SA1503.severity = suggestion

# All accessors should be single-line or multi-line
dotnet_diagnostic.SA1504.severity = suggestion
dotnet_diagnostic.SA1504.severity = warning

# An opening brace should not be followed by a blank line
dotnet_diagnostic.SA1505.severity = suggestion
Expand Down
6 changes: 5 additions & 1 deletion src/Build/Construction/Solution/ProjectInSolution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ internal ProjectInSolution(SolutionFile solution)
/// </summary>
public string RelativePath
{
get { return _relativePath; }
get
{
return _relativePath;
}

internal set
{
#if NETFRAMEWORK && !MONO
Expand Down
10 changes: 8 additions & 2 deletions src/Build/Definition/ProjectItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,14 @@ public string UnevaluatedInclude
{
[DebuggerStepThrough]
get
{ return _xml.Include; }
set { Rename(value); }
{
return _xml.Include;
}

set
{
Rename(value);
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ internal Builder(ImmutableList<ItemData>.Builder listBuilder)

public ItemData this[int index]
{
get { return _listBuilder[index]; }
get
{
return _listBuilder[index];
}

set
{
// Update the dictionary if it exists.
Copy link
Member

Choose a reason for hiding this comment

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

Is it unintentionally missing comment also?

if (_dictionaryBuilder is not null)
{
ItemData oldItemData = _listBuilder[index];
Expand Down
30 changes: 24 additions & 6 deletions src/Build/Instance/ProjectInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,14 @@ TaskRegistry IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, Projec
{
[DebuggerStepThrough]
get
{ return TaskRegistry; }
set { TaskRegistry = value; }
{
return TaskRegistry;
}

set
{
TaskRegistry = value;
}
}

/// <summary>
Expand Down Expand Up @@ -1074,8 +1080,14 @@ List<string> IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, Projec
{
[DebuggerStepThrough]
get
{ return InitialTargets; }
set { InitialTargets = value; }
{
return InitialTargets;
}

set
{
InitialTargets = value;
}
Comment on lines 1082 to +1090
Copy link
Member

Choose a reason for hiding this comment

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

This property looks like a candidate for the single-line version. Would this not fix the warning?

            get { return InitialTargets; }
            set { InitialTargets = value; }

Same for a couple of similar props in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried, but I still get an error because of the [DebuggerStepThrough] attribute. We need to probably raise another issue for the analyzer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

/// <summary>
Expand All @@ -1086,8 +1098,14 @@ List<string> IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, Projec
{
[DebuggerStepThrough]
get
{ return DefaultTargets; }
set { DefaultTargets = value; }
{
return DefaultTargets;
}

set
{
DefaultTargets = value;
}
}

/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion src/Build/Logging/BaseConsoleLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,11 @@ internal PerformanceCounter(string scopeName)
/// </summary>
internal bool InScope
{
get { return inScope; }
get
{
return inScope;
}

set
{
if (!reenteredScope)
Expand Down
6 changes: 5 additions & 1 deletion src/Framework/ReuseableStringBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ internal sealed class ReuseableStringBuilder : IDisposable
/// </summary>
public int Length
{
get { return _borrowedBuilder?.Length ?? 0; }
get
{
return _borrowedBuilder?.Length ?? 0;
}

set
{
LazyPrepare();
Expand Down
6 changes: 5 additions & 1 deletion src/Tasks/AssemblyDependency/Reference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ internal List<string> GetSerializationAssemblyFiles()
/// <value>The full path to this assembly.</value>
internal string FullPath
{
get { return _fullPath; }
get
{
return _fullPath;
}

set
{
if (_fullPath != value)
Expand Down
18 changes: 15 additions & 3 deletions src/Tasks/AssemblyDependency/ResolveAssemblyReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,11 @@ public bool IgnoreTargetFrameworkAttributeVersionMismatch
/// </summary>
public string[] TargetFrameworkSubsets
{
get { return _targetFrameworkSubsets; }
get
{
return _targetFrameworkSubsets;
}

set
{
ErrorUtilities.VerifyThrowArgumentNull(value, "TargetFrameworkSubsets");
Expand Down Expand Up @@ -450,7 +454,11 @@ public ITaskItem[] InstalledAssemblyTables
/// </summary>
public ITaskItem[] InstalledAssemblySubsetTables
{
get { return _installedAssemblySubsetTables; }
get
{
return _installedAssemblySubsetTables;
}

set
{
ErrorUtilities.VerifyThrowArgumentNull(value, "InstalledAssemblySubsetTables");
Expand All @@ -477,7 +485,11 @@ public ITaskItem[] InstalledAssemblySubsetTables
/// </summary>
public ITaskItem[] FullFrameworkAssemblyTables
{
get { return _fullFrameworkAssemblyTables; }
get
{
return _fullFrameworkAssemblyTables;
}

set
{
ErrorUtilities.VerifyThrowArgumentNull(value, "FullFrameworkAssemblyTables");
Expand Down
8 changes: 6 additions & 2 deletions src/Tasks/GenerateResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public ITaskItem[] FilesWritten
}

/// <summary>
/// The language to use when generating the class source for the strongly typed resource.
/// Gets or sets the language to use when generating the class source for the strongly typed resource.
/// This parameter must match exactly one of the languages used by the CodeDomProvider.
/// </summary>
public string StronglyTypedLanguage
Expand All @@ -263,7 +263,11 @@ public string StronglyTypedLanguage
// try to validate it -- that might prevent future expansion of supported languages.
_stronglyTypedLanguage = value;
}
get { return _stronglyTypedLanguage; }

get
{
return _stronglyTypedLanguage;
}
}

/// <summary>
Expand Down