Skip to content

Commit 36951e0

Browse files
authored
Redundancy: Remove 'partial' modifier from type with a single part (PowerShell#12725)
# PR Summary Fix RCS1043 ## PR Context https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1043.md ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here --> - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: <!-- Number/link of that issue here --> - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
1 parent d98f131 commit 36951e0

9 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.PowerShell.Commands
88
{
9-
internal static partial class HttpKnownHeaderNames
9+
internal static class HttpKnownHeaderNames
1010
{
1111
#region Known_HTTP_Header_Names
1212

src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseHelper.CoreClr.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Microsoft.PowerShell.Commands
1010
{
11-
internal static partial class WebResponseHelper
11+
internal static class WebResponseHelper
1212
{
1313
internal static string GetCharacterSet(HttpResponseMessage response)
1414
{

src/Microsoft.WSMan.Management/ConfigProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.WSMan.Management
2424
/// WsMan Provider.
2525
/// </summary>
2626
[CmdletProvider(WSManStringLiterals.ProviderName, ProviderCapabilities.Credentials)]
27-
public sealed partial class WSManConfigProvider : NavigationCmdletProvider, ICmdletProviderSupportsHelp
27+
public sealed class WSManConfigProvider : NavigationCmdletProvider, ICmdletProviderSupportsHelp
2828
{
2929
// Plugin Name Storage
3030
private PSObject objPluginNames = null;

src/System.Management.Automation/engine/cmdlet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace System.Management.Automation
3030
/// task, extending the Cmdlet or PSCmdlet classes only as a thin management layer.
3131
/// </remarks>
3232
/// <seealso cref="System.Management.Automation.Internal.InternalCommand"/>
33-
public abstract partial class Cmdlet : InternalCommand
33+
public abstract class Cmdlet : InternalCommand
3434
{
3535
#region public_properties
3636

src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace System.Management.Automation.Interpreter
2020
/// <summary>
2121
/// Implements dynamic call site with many arguments. Wraps the arguments into <see cref="ArgumentArray"/>.
2222
/// </summary>
23-
internal sealed partial class DynamicSplatInstruction : Instruction
23+
internal sealed class DynamicSplatInstruction : Instruction
2424
{
2525
private readonly CallSite<Func<CallSite, ArgumentArray, object>> _site;
2626
private readonly int _argumentCount;

src/System.Management.Automation/engine/interpreter/Instruction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal interface IInstructionProvider
2222
void AddInstructions(LightCompiler compiler);
2323
}
2424

25-
internal abstract partial class Instruction
25+
internal abstract class Instruction
2626
{
2727
public const int UnknownInstrIndex = int.MaxValue;
2828

src/System.Management.Automation/engine/interpreter/Utilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ internal static T[] AddLast<T>(this IList<T> list, T item)
126126
}
127127
}
128128

129-
internal static partial class DelegateHelpers
129+
internal static class DelegateHelpers
130130
{
131131
#region Generated Maximum Delegate Arity
132132

src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Microsoft.PowerShell.Commands
2727
/// It contains tons of utility functions which are used all
2828
/// across the remoting cmdlets.
2929
/// </summary>
30-
public abstract partial class PSRemotingCmdlet : PSCmdlet
30+
public abstract class PSRemotingCmdlet : PSCmdlet
3131
{
3232
#region Overrides
3333

@@ -296,7 +296,7 @@ internal struct SSHConnection
296296
/// 2. Invoke-Expression
297297
/// 3. Start-PSJob.
298298
/// </summary>
299-
public abstract partial class PSRemotingBaseCmdlet : PSRemotingCmdlet
299+
public abstract class PSRemotingBaseCmdlet : PSRemotingCmdlet
300300
{
301301
#region Enums
302302

@@ -1149,7 +1149,7 @@ protected override void BeginProcessing()
11491149
/// 1. Invoke-Expression
11501150
/// 2. Start-PSJob.
11511151
/// </summary>
1152-
public abstract partial class PSExecutionCmdlet : PSRemotingBaseCmdlet
1152+
public abstract class PSExecutionCmdlet : PSRemotingBaseCmdlet
11531153
{
11541154
#region Strings
11551155

@@ -2448,7 +2448,7 @@ private List<VariableExpressionAst> GetUsingVariables(ScriptBlock localScriptBlo
24482448
/// 3. Disconnect-PSSession
24492449
/// 4. Connect-PSSession.
24502450
/// </summary>
2451-
public abstract partial class PSRunspaceCmdlet : PSRemotingCmdlet
2451+
public abstract class PSRunspaceCmdlet : PSRemotingCmdlet
24522452
{
24532453
#region Parameters
24542454

@@ -3222,7 +3222,7 @@ private void WriteInvalidArgumentError(PSRemotingErrorId errorId, string resourc
32223222
/// Base class for both the helpers. This is an abstract class
32233223
/// and the helpers need to derive from this.
32243224
/// </summary>
3225-
internal abstract partial class ExecutionCmdletHelper : IThrottleOperation
3225+
internal abstract class ExecutionCmdletHelper : IThrottleOperation
32263226
{
32273227
/// <summary>
32283228
/// Pipeline associated with this operation.

src/System.Management.Automation/utils/ExtensionMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ internal static int SequenceGetHashCode<T>(this IEnumerable<T> xs)
6868
/// * If you want to add an extension method that will be used only by CoreCLR powershell, please add it to the partial
6969
/// 'PSTypeExtensions' class in 'CorePsExtensions.cs'.
7070
/// </summary>
71-
internal static partial class PSTypeExtensions
71+
internal static class PSTypeExtensions
7272
{
7373
/// <summary>
7474
/// Check does the type have an instance default constructor with visibility that allows calling it from subclass.

0 commit comments

Comments
 (0)