Skip to content

Commit

Permalink
(maint) Corrected naming of private fields
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Mar 26, 2021
1 parent a5af745 commit 0f5fcc9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions Source/Cake.Codecov/Cake.Codecov.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<Rule Id="SA1303" Action="Error" />
<Rule Id="SA1304" Action="Error" />
<Rule Id="SA1305" Action="Warning" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1311" Action="Error" />
<Rule Id="SA1400" Action="Error" />
<Rule Id="SA1401" Action="Error" />
Expand Down
8 changes: 4 additions & 4 deletions Source/Cake.Codecov/CodecovRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Cake.Codecov
{
internal sealed class CodecovRunner : Tool<CodecovSettings>
{
private readonly IPlatformDetector platformDetector;
private readonly IPlatformDetector _platformDetector;

internal CodecovRunner(IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools)
: this(new PlatformDetector(), fileSystem, environment, processRunner, tools)
Expand All @@ -26,7 +26,7 @@ internal CodecovRunner(IFileSystem fileSystem, ICakeEnvironment environment, IPr
internal CodecovRunner(IPlatformDetector platformDetector, IFileSystem fileSystem, ICakeEnvironment environment, IProcessRunner processRunner, IToolLocator tools)
: base(fileSystem, environment, processRunner, tools)
{
this.platformDetector = platformDetector ?? throw new ArgumentNullException(nameof(platformDetector));
_platformDetector = platformDetector ?? throw new ArgumentNullException(nameof(platformDetector));
}

internal void Run(CodecovSettings settings)
Expand All @@ -41,12 +41,12 @@ internal void Run(CodecovSettings settings)

protected override IEnumerable<string> GetToolExecutableNames()
{
if (platformDetector.IsLinuxPlatform())
if (_platformDetector.IsLinuxPlatform())
{
yield return "linux-x64/codecov";
yield return "codecov";
}
else if (platformDetector.IsOsxPlatform())
else if (_platformDetector.IsOsxPlatform())
{
yield return "osx-x64/codecov";
yield return "codecov";
Expand Down
12 changes: 6 additions & 6 deletions Source/Cake.Codecov/CodecovSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Cake.Codecov
/// </summary>
public sealed class CodecovSettings : ToolSettings
{
private readonly IDictionary<string, object> arguments = new Dictionary<string, object>();
private readonly IDictionary<string, object> _arguments = new Dictionary<string, object>();

/// <summary>
/// Gets or sets a property specifing the branch name.
Expand Down Expand Up @@ -255,11 +255,11 @@ public bool Verbose
}

internal IDictionary<string, object> GetAllArguments()
=> arguments;
=> _arguments;

private TValue GetValue<TValue>(string key, TValue defaultValue = default)
{
if (arguments.TryGetValue(key, out var objValue) && objValue is TValue value)
if (_arguments.TryGetValue(key, out var objValue) && objValue is TValue value)
{
return value;
}
Expand All @@ -271,15 +271,15 @@ private void SetValue(string key, object value)
{
if (value is string stringValue && string.IsNullOrWhiteSpace(stringValue))
{
if (arguments.ContainsKey(key))
if (_arguments.ContainsKey(key))
{
arguments.Remove(key);
_arguments.Remove(key);
}

return;
}

arguments[key] = value;
_arguments[key] = value;
}
}
}
2 changes: 1 addition & 1 deletion Source/Cake.Codecov/Internals/PlatformDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Cake.Codecov.Internals
{
/// <summary>
/// Responsible for detecting the current platfrom we are running on. Also used for unit test.
/// Responsible for detecting the current platform we are running on. Also used for unit test.
/// </summary>
/// <remarks>This class is not to be consumed publically.</remarks>
internal class PlatformDetector : IPlatformDetector
Expand Down

0 comments on commit 0f5fcc9

Please sign in to comment.