Skip to content

Commit 01f61ed

Browse files
Evangelinkarturcic
authored andcommitted
Remove underscore prefix for fields
1 parent 0cc298e commit 01f61ed

File tree

5 files changed

+54
-54
lines changed

5 files changed

+54
-54
lines changed

src/GitTools.Testing/Fixtures/RepositoryFixtureBase.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace GitTools.Testing
99
/// </summary>
1010
public abstract class RepositoryFixtureBase : IDisposable
1111
{
12-
private readonly SequenceDiagram _sequenceDiagram;
12+
private readonly SequenceDiagram sequenceDiagram;
1313

1414
protected RepositoryFixtureBase(Func<string, IRepository> repoBuilder)
1515
: this(repoBuilder(PathHelper.GetTempPath()))
@@ -18,7 +18,7 @@ protected RepositoryFixtureBase(Func<string, IRepository> repoBuilder)
1818

1919
protected RepositoryFixtureBase(IRepository repository)
2020
{
21-
this._sequenceDiagram = new SequenceDiagram();
21+
this.sequenceDiagram = new SequenceDiagram();
2222
Repository = repository;
2323
Repository.Config.Set("user.name", "Test");
2424
Repository.Config.Set("user.email", "[email protected]");
@@ -33,7 +33,7 @@ public string RepositoryPath
3333

3434
public SequenceDiagram SequenceDiagram
3535
{
36-
get { return this._sequenceDiagram; }
36+
get { return this.sequenceDiagram; }
3737
}
3838

3939
/// <summary>
@@ -53,10 +53,10 @@ public virtual void Dispose()
5353
e.Message);
5454
}
5555

56-
this._sequenceDiagram.End();
56+
this.sequenceDiagram.End();
5757
Console.WriteLine("**Visualisation of test:**");
5858
Console.WriteLine(string.Empty);
59-
Console.WriteLine(this._sequenceDiagram.GetDiagram());
59+
Console.WriteLine(this.sequenceDiagram.GetDiagram());
6060
}
6161

6262
public void Checkout(string branch) => Commands.Checkout(Repository, branch);
@@ -71,28 +71,28 @@ public void MakeATaggedCommit(string tag)
7171

7272
public void ApplyTag(string tag)
7373
{
74-
this._sequenceDiagram.ApplyTag(tag, Repository.Head.FriendlyName);
74+
this.sequenceDiagram.ApplyTag(tag, Repository.Head.FriendlyName);
7575
Repository.ApplyTag(tag);
7676
}
7777

7878
public void BranchTo(string branchName, string @as = null)
7979
{
80-
this._sequenceDiagram.BranchTo(branchName, Repository.Head.FriendlyName, @as);
80+
this.sequenceDiagram.BranchTo(branchName, Repository.Head.FriendlyName, @as);
8181
var branch = Repository.CreateBranch(branchName);
8282
Commands.Checkout(Repository, branch);
8383
}
8484

8585
public void BranchToFromTag(string branchName, string fromTag, string onBranch, string @as = null)
8686
{
87-
this._sequenceDiagram.BranchToFromTag(branchName, fromTag, onBranch, @as);
87+
this.sequenceDiagram.BranchToFromTag(branchName, fromTag, onBranch, @as);
8888
var branch = Repository.CreateBranch(branchName);
8989
Commands.Checkout(Repository, branch);
9090
}
9191

9292
public void MakeACommit()
9393
{
9494
var to = Repository.Head.FriendlyName;
95-
this._sequenceDiagram.MakeACommit(to);
95+
this.sequenceDiagram.MakeACommit(to);
9696
Repository.MakeACommit();
9797
}
9898

@@ -101,7 +101,7 @@ public void MakeACommit()
101101
/// </summary>
102102
public void MergeNoFF(string mergeSource)
103103
{
104-
this._sequenceDiagram.Merge(mergeSource, Repository.Head.FriendlyName);
104+
this.sequenceDiagram.Merge(mergeSource, Repository.Head.FriendlyName);
105105
Repository.MergeNoFF(mergeSource, Generate.SignatureNow());
106106
}
107107

src/GitTools.Testing/Fixtures/SequenceDiagram.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,49 @@ namespace GitTools.Testing
99
/// </summary>
1010
public class SequenceDiagram
1111
{
12-
private readonly Dictionary<string, string> _participants = new();
13-
private readonly StringBuilder _diagramBuilder;
12+
private readonly Dictionary<string, string> participants = new();
13+
private readonly StringBuilder diagramBuilder;
1414

1515
/// <summary>
1616
/// Initializes a new instance of the <see cref="T:SequenceDiagram"/> class.
1717
/// </summary>
1818
public SequenceDiagram()
1919
{
20-
this._diagramBuilder = new StringBuilder();
21-
this._diagramBuilder.AppendLine("@startuml");
20+
this.diagramBuilder = new StringBuilder();
21+
this.diagramBuilder.AppendLine("@startuml");
2222
}
2323

2424
/// <summary>
2525
/// Activates a branch/participant in the sequence diagram
2626
/// </summary>
27-
public void Activate(string branch) => this._diagramBuilder.AppendLineFormat("activate {0}", GetParticipant(branch));
27+
public void Activate(string branch) => this.diagramBuilder.AppendLineFormat("activate {0}", GetParticipant(branch));
2828

2929
/// <summary>
3030
/// Destroys a branch/participant in the sequence diagram
3131
/// </summary>
32-
public void Destroy(string branch) => this._diagramBuilder.AppendLineFormat("destroy {0}", GetParticipant(branch));
32+
public void Destroy(string branch) => this.diagramBuilder.AppendLineFormat("destroy {0}", GetParticipant(branch));
3333

3434
/// <summary>
3535
/// Creates a participant in the sequence diagram
3636
/// </summary>
3737
public void Participant(string participant, string @as = null)
3838
{
39-
this._participants.Add(participant, @as ?? participant);
39+
this.participants.Add(participant, @as ?? participant);
4040
if (@as == null)
41-
this._diagramBuilder.AppendLineFormat("participant {0}", participant);
41+
this.diagramBuilder.AppendLineFormat("participant {0}", participant);
4242
else
43-
this._diagramBuilder.AppendLineFormat("participant \"{0}\" as {1}", participant, @as);
43+
this.diagramBuilder.AppendLineFormat("participant \"{0}\" as {1}", participant, @as);
4444
}
4545

4646
/// <summary>
4747
/// Appends a divider with specified text to the sequence diagram
4848
/// </summary>
49-
public void Divider(string text) => this._diagramBuilder.AppendLineFormat("== {0} ==", text);
49+
public void Divider(string text) => this.diagramBuilder.AppendLineFormat("== {0} ==", text);
5050

5151
/// <summary>
5252
/// Appends a note over one or many participants to the sequence diagram
5353
/// </summary>
54-
public void NoteOver(string noteText, string startParticipant, string endParticipant = null, string prefix = null, string color = null) => this._diagramBuilder.AppendLineFormat(
54+
public void NoteOver(string noteText, string startParticipant, string endParticipant = null, string prefix = null, string color = null) => this.diagramBuilder.AppendLineFormat(
5555
prefix + @"note over {0}{1}{2}
5656
{3}
5757
end note",
@@ -63,20 +63,20 @@ public void NoteOver(string noteText, string startParticipant, string endPartici
6363
/// <summary>
6464
/// Appends applying a tag to the specified branch/participant to the sequence diagram
6565
/// </summary>
66-
public void ApplyTag(string tag, string toBranch) => this._diagramBuilder.AppendLineFormat("{0} -> {0}: tag {1}", GetParticipant(toBranch), tag);
66+
public void ApplyTag(string tag, string toBranch) => this.diagramBuilder.AppendLineFormat("{0} -> {0}: tag {1}", GetParticipant(toBranch), tag);
6767

6868
/// <summary>
6969
/// Appends branching from a branch to another branch, @as can override the participant name
7070
/// </summary>
7171
public void BranchTo(string branchName, string currentName, string @as)
7272
{
73-
if (!this._participants.ContainsKey(branchName))
73+
if (!this.participants.ContainsKey(branchName))
7474
{
75-
this._diagramBuilder.Append("create ");
75+
this.diagramBuilder.Append("create ");
7676
Participant(branchName, @as);
7777
}
7878

79-
this._diagramBuilder.AppendLineFormat(
79+
this.diagramBuilder.AppendLineFormat(
8080
"{0} -> {1}: branch from {2}",
8181
GetParticipant(currentName),
8282
GetParticipant(branchName), currentName);
@@ -87,41 +87,41 @@ public void BranchTo(string branchName, string currentName, string @as)
8787
/// </summary>
8888
public void BranchToFromTag(string branchName, string fromTag, string onBranch, string @as)
8989
{
90-
if (!this._participants.ContainsKey(branchName))
90+
if (!this.participants.ContainsKey(branchName))
9191
{
92-
this._diagramBuilder.Append("create ");
92+
this.diagramBuilder.Append("create ");
9393
Participant(branchName, @as);
9494
}
9595

96-
this._diagramBuilder.AppendLineFormat("{0} -> {1}: branch from tag ({2})", GetParticipant(onBranch), GetParticipant(branchName), fromTag);
96+
this.diagramBuilder.AppendLineFormat("{0} -> {1}: branch from tag ({2})", GetParticipant(onBranch), GetParticipant(branchName), fromTag);
9797
}
9898

9999
/// <summary>
100100
/// Appends a commit on the target participant/branch to the sequence diagram
101101
/// </summary>
102-
public void MakeACommit(string toParticipant) => this._diagramBuilder.AppendLineFormat("{0} -> {0}: commit", GetParticipant(toParticipant));
102+
public void MakeACommit(string toParticipant) => this.diagramBuilder.AppendLineFormat("{0} -> {0}: commit", GetParticipant(toParticipant));
103103

104104
/// <summary>
105105
/// Append a merge to the sequence diagram
106106
/// </summary>
107-
public void Merge(string @from, string to) => this._diagramBuilder.AppendLineFormat("{0} -> {1}: merge", GetParticipant(@from), GetParticipant(to));
107+
public void Merge(string @from, string to) => this.diagramBuilder.AppendLineFormat("{0} -> {1}: merge", GetParticipant(@from), GetParticipant(to));
108108

109109
private string GetParticipant(string branch)
110110
{
111-
if (this._participants.ContainsKey(branch))
112-
return this._participants[branch];
111+
if (this.participants.ContainsKey(branch))
112+
return this.participants[branch];
113113

114114
return branch;
115115
}
116116

117117
/// <summary>
118118
/// Ends the sequence diagram
119119
/// </summary>
120-
public void End() => this._diagramBuilder.AppendLine("@enduml");
120+
public void End() => this.diagramBuilder.AppendLine("@enduml");
121121

122122
/// <summary>
123123
/// returns the plantUML representation of the Sequence Diagram
124124
/// </summary>
125-
public string GetDiagram() => this._diagramBuilder.ToString();
125+
public string GetDiagram() => this.diagramBuilder.ToString();
126126
}
127127
}

src/GitVersion.App/OverrideConfigOptionParser.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class OverrideConfigOptionParser
1010
private static readonly Lazy<ILookup<string, PropertyInfo>> _lazySupportedProperties =
1111
new(GetSupportedProperties, true);
1212

13-
private readonly Lazy<Config> _lazyConfig = new();
13+
private readonly Lazy<Config> lazyConfig = new();
1414

1515
internal static ILookup<string, PropertyInfo> SupportedProperties => _lazySupportedProperties.Value;
1616

@@ -66,13 +66,13 @@ internal void SetValue(string key, string value)
6666
unwrapped = pi.PropertyType;
6767

6868
if (unwrapped == typeof(string))
69-
pi.SetValue(this._lazyConfig.Value, unwrappedText);
69+
pi.SetValue(this.lazyConfig.Value, unwrappedText);
7070
else if (unwrapped.IsEnum)
7171
{
7272
try
7373
{
7474
var parsedEnum = Enum.Parse(unwrapped, unwrappedText);
75-
pi.SetValue(this._lazyConfig.Value, parsedEnum);
75+
pi.SetValue(this.lazyConfig.Value, parsedEnum);
7676
}
7777
catch (ArgumentException)
7878
{
@@ -89,20 +89,20 @@ internal void SetValue(string key, string value)
8989
else if (unwrapped == typeof(int))
9090
{
9191
if (int.TryParse(unwrappedText, out int parsedInt))
92-
pi.SetValue(this._lazyConfig.Value, parsedInt);
92+
pi.SetValue(this.lazyConfig.Value, parsedInt);
9393
else
9494
throw new WarningException($"Could not parse /overrideconfig option: {key}={value}. Ensure that 'value' is valid integer number.");
9595
}
9696
else if (unwrapped == typeof(bool))
9797
{
9898
if (bool.TryParse(unwrappedText, out bool parsedBool))
99-
pi.SetValue(this._lazyConfig.Value, parsedBool);
99+
pi.SetValue(this.lazyConfig.Value, parsedBool);
100100
else
101101
throw new WarningException($"Could not parse /overrideconfig option: {key}={value}. Ensure that 'value' is 'true' or 'false'.");
102102
}
103103
}
104104
}
105105

106-
internal Config GetConfig() => this._lazyConfig.IsValueCreated ? this._lazyConfig.Value : null;
106+
internal Config GetConfig() => this.lazyConfig.IsValueCreated ? this.lazyConfig.Value : null;
107107
}
108108
}

src/GitVersion.Core/Configuration/ConfigurationBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ public class ConfigurationBuilder
1212
{
1313
private const int DefaultTagPreReleaseWeight = 60000;
1414

15-
private readonly List<Config> _overrides = new();
15+
private readonly List<Config> overrides = new();
1616

1717
public ConfigurationBuilder Add([NotNull] Config config)
1818
{
1919
if (config == null) throw new ArgumentNullException(nameof(config));
2020

21-
this._overrides.Add(config);
21+
this.overrides.Add(config);
2222
return this;
2323
}
2424

@@ -27,7 +27,7 @@ public Config Build()
2727
{
2828
var config = CreateDefaultConfiguration();
2929

30-
foreach (var overrideConfig in this._overrides)
30+
foreach (var overrideConfig in this.overrides)
3131
{
3232
ApplyOverrides(config, overrideConfig);
3333
}

src/GitVersion.MsBuild.Tests/Mocks/MockEngine.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace GitVersion.MsBuild.Tests.Mocks
1111
{
1212
internal sealed class MockEngine : IBuildEngine4
1313
{
14-
private readonly ConcurrentDictionary<object, object> _objectCache = new();
15-
private StringBuilder _log = new();
14+
private readonly ConcurrentDictionary<object, object> objectCache = new();
15+
private StringBuilder log = new();
1616

1717
internal MessageImportance MinimumMessageImportance { get; set; } = MessageImportance.Low;
1818

@@ -27,21 +27,21 @@ internal sealed class MockEngine : IBuildEngine4
2727
public void LogErrorEvent(BuildErrorEventArgs eventArgs)
2828
{
2929
Console.WriteLine(EventArgsFormatting.FormatEventMessage(eventArgs));
30-
this._log.AppendLine(EventArgsFormatting.FormatEventMessage(eventArgs));
30+
this.log.AppendLine(EventArgsFormatting.FormatEventMessage(eventArgs));
3131
++Errors;
3232
}
3333

3434
public void LogWarningEvent(BuildWarningEventArgs eventArgs)
3535
{
3636
Console.WriteLine(EventArgsFormatting.FormatEventMessage(eventArgs));
37-
this._log.AppendLine(EventArgsFormatting.FormatEventMessage(eventArgs));
37+
this.log.AppendLine(EventArgsFormatting.FormatEventMessage(eventArgs));
3838
++Warnings;
3939
}
4040

4141
public void LogCustomEvent(CustomBuildEventArgs eventArgs)
4242
{
4343
Console.WriteLine(eventArgs.Message);
44-
this._log.AppendLine(eventArgs.Message);
44+
this.log.AppendLine(eventArgs.Message);
4545
}
4646

4747
public void LogMessageEvent(BuildMessageEventArgs eventArgs)
@@ -50,7 +50,7 @@ public void LogMessageEvent(BuildMessageEventArgs eventArgs)
5050
if (eventArgs.Importance <= MinimumMessageImportance)
5151
{
5252
Console.WriteLine(eventArgs.Message);
53-
this._log.AppendLine(eventArgs.Message);
53+
this.log.AppendLine(eventArgs.Message);
5454
++Messages;
5555
}
5656
}
@@ -65,8 +65,8 @@ public void LogMessageEvent(BuildMessageEventArgs eventArgs)
6565

6666
public string Log
6767
{
68-
set => this._log = new StringBuilder(value);
69-
get => this._log.ToString();
68+
set => this.log = new StringBuilder(value);
69+
get => this.log.ToString();
7070
}
7171

7272
public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) => false;
@@ -114,15 +114,15 @@ public void Reacquire()
114114

115115
public object GetRegisteredTaskObject(object key, RegisteredTaskObjectLifetime lifetime)
116116
{
117-
this._objectCache.TryGetValue(key, out var obj);
117+
this.objectCache.TryGetValue(key, out var obj);
118118
return obj;
119119
}
120120

121-
public void RegisterTaskObject(object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection) => this._objectCache[key] = obj;
121+
public void RegisterTaskObject(object key, object obj, RegisteredTaskObjectLifetime lifetime, bool allowEarlyCollection) => this.objectCache[key] = obj;
122122

123123
public object UnregisterTaskObject(object key, RegisteredTaskObjectLifetime lifetime)
124124
{
125-
this._objectCache.TryRemove(key, out var obj);
125+
this.objectCache.TryRemove(key, out var obj);
126126
return obj;
127127
}
128128
}

0 commit comments

Comments
 (0)