From db16466375863c89b696dbc21c8c007dcfa746ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Mon, 26 Apr 2021 17:31:43 +0200 Subject: [PATCH 01/13] Enforce `this.` qualifier for fields --- src/GitVersion.sln.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 54382e006f..bd6abf7165 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -127,6 +127,7 @@ <?xml version="1.0" encoding="utf-16"?><Profile name="Format My Code Using &quot;Particular&quot; conventions"><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUseVar><BehavourStyle>CAN_CHANGE_TO_IMPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_IMPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_IMPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSReorderTypeMembers>True</CSReorderTypeMembers><JsInsertSemicolon>True</JsInsertSemicolon><JsReformatCode>True</JsReformatCode><CssReformatCode>True</CssReformatCode><CSArrangeThisQualifier>True</CSArrangeThisQualifier><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><HtmlReformatCode>True</HtmlReformatCode><CSShortenReferences>True</CSShortenReferences><CSharpFormatDocComments>True</CSharpFormatDocComments><CssAlphabetizeProperties>True</CssAlphabetizeProperties></Profile> Default: Reformat Code Format My Code Using "Particular" conventions + Field False False ALWAYS_ADD From 7bf9dc345cf3a766e768e8caaa3441fc3c3010ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Mon, 26 Apr 2021 21:28:25 +0200 Subject: [PATCH 02/13] Warn on inconsistent naming --- src/GitVersion.sln.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index bd6abf7165..2c9fc2591d 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -41,7 +41,7 @@ DO_NOT_SHOW DO_NOT_SHOW ERROR - DO_NOT_SHOW + WARNING DO_NOT_SHOW ERROR ERROR From cbbb38e2ac4fdf47e8e381426bb01b2df6b5956a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Mon, 26 Apr 2021 21:54:52 +0200 Subject: [PATCH 03/13] Add "FF" to list of known abbreviations --- src/GitVersion.sln.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 2c9fc2591d..920f8c6871 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -501,6 +501,7 @@ II.2.12 <HandlesEvent /> False DB DTC + FF ID NSB SLA From daf8f08ab13a6c6afcbaa7ab4ee6c12d58be2054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Mon, 26 Apr 2021 22:01:48 +0200 Subject: [PATCH 04/13] Don't indent XML doc text --- src/GitVersion.sln.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 920f8c6871..dcc02659d1 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -145,6 +145,7 @@ CHOP_ALWAYS True True + ZeroIndent <?xml version="1.0" encoding="utf-16"?> <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> <TypePattern DisplayName="COM interfaces or structs"> From d0950a5d592a2c01fd12596c43284d9bcb870e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Mon, 26 Apr 2021 22:20:05 +0200 Subject: [PATCH 05/13] Adjust blank line and brace settings --- src/GitVersion.sln.DotSettings | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index dcc02659d1..664b339681 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -127,7 +127,16 @@ <?xml version="1.0" encoding="utf-16"?><Profile name="Format My Code Using &quot;Particular&quot; conventions"><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSUseVar><BehavourStyle>CAN_CHANGE_TO_IMPLICIT</BehavourStyle><LocalVariableStyle>ALWAYS_IMPLICIT</LocalVariableStyle><ForeachVariableStyle>ALWAYS_IMPLICIT</ForeachVariableStyle></CSUseVar><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSReorderTypeMembers>True</CSReorderTypeMembers><JsInsertSemicolon>True</JsInsertSemicolon><JsReformatCode>True</JsReformatCode><CssReformatCode>True</CssReformatCode><CSArrangeThisQualifier>True</CSArrangeThisQualifier><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><HtmlReformatCode>True</HtmlReformatCode><CSShortenReferences>True</CSShortenReferences><CSharpFormatDocComments>True</CSharpFormatDocComments><CssAlphabetizeProperties>True</CssAlphabetizeProperties></Profile> Default: Reformat Code Format My Code Using "Particular" conventions + Required + Required + Required + Required + False Field + 1 + 1 + 1 + 1 False False ALWAYS_ADD From 4135808a54c3b4d1dec5ded58d86eb9dba787cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Tue, 27 Apr 2021 01:08:52 +0200 Subject: [PATCH 06/13] Adjust spaces and alignment --- src/GitVersion.sln.DotSettings | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 664b339681..956f2c322c 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -133,6 +133,14 @@ Required False Field + True + True + True + True + True + True + True + True 1 1 1 @@ -144,14 +152,25 @@ ALWAYS_ADD ALWAYS_ADD ALWAYS_ADD + False + False + False + False NEVER + False False + True CHOP_ALWAYS + True + True + CHOP_IF_LONG + CHOP_IF_LONG False CHOP_ALWAYS CHOP_ALWAYS + CHOP_IF_LONG True True ZeroIndent From 3e50182f156fac341568938c6fd2b26a31fa9ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Tue, 27 Apr 2021 02:55:12 +0200 Subject: [PATCH 07/13] Prefer expression body --- src/GitVersion.sln.DotSettings | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 956f2c322c..f1f60e8b07 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -132,6 +132,9 @@ Required Required False + ExpressionBody + ExpressionBody + ExpressionBody Field True True From e38adf04f080dcf21e626b03eb59261a9462e0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Tue, 27 Apr 2021 12:33:00 +0200 Subject: [PATCH 08/13] Prefer CLR names for built-in type member access --- src/GitVersion.sln.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index f1f60e8b07..f5d7413364 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -132,6 +132,7 @@ Required Required False + UseClrName ExpressionBody ExpressionBody ExpressionBody From fd3eaecd88a4084d21e933200c001393e85f661a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Tue, 27 Apr 2021 12:53:08 +0200 Subject: [PATCH 09/13] More line break adjustments --- src/GitVersion.sln.DotSettings | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index f5d7413364..1d5ae3241f 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -157,13 +157,16 @@ ALWAYS_ADD ALWAYS_ADD False - False + True False False NEVER False + IF_OWNER_IS_SINGLE_LINE + IF_OWNER_IS_SINGLE_LINE False True + CHOP_IF_LONG CHOP_ALWAYS From 945a868dbad33761033c5cc4d7308b15f8f76fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Sat, 1 May 2021 02:16:12 +0200 Subject: [PATCH 10/13] Wrap lines --- src/GitVersion.sln.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitVersion.sln.DotSettings b/src/GitVersion.sln.DotSettings index 1d5ae3241f..1460e4c914 100644 --- a/src/GitVersion.sln.DotSettings +++ b/src/GitVersion.sln.DotSettings @@ -174,7 +174,7 @@ True CHOP_IF_LONG CHOP_IF_LONG - False + True CHOP_ALWAYS CHOP_ALWAYS CHOP_IF_LONG From 28845abfacb732c6f8f1578f6a6124a1e00c27c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Sat, 1 May 2021 02:27:06 +0200 Subject: [PATCH 11/13] Move CommitSortStrategies to its own file --- src/GitVersion.Core/Git/CommitFilter.cs | 35 ------------------ .../Git/CommitSortStrategies.cs | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 35 deletions(-) create mode 100644 src/GitVersion.Core/Git/CommitSortStrategies.cs diff --git a/src/GitVersion.Core/Git/CommitFilter.cs b/src/GitVersion.Core/Git/CommitFilter.cs index dbcb395cc1..58b7512933 100644 --- a/src/GitVersion.Core/Git/CommitFilter.cs +++ b/src/GitVersion.Core/Git/CommitFilter.cs @@ -1,45 +1,10 @@ -using System; - namespace GitVersion { public class CommitFilter { - public bool FirstParentOnly { get; set; } public object IncludeReachableFrom { get; set; } public object ExcludeReachableFrom { get; set; } public CommitSortStrategies SortBy { get; set; } } - - [Flags] - public enum CommitSortStrategies - { - /// - /// Sort the commits in no particular ordering; - /// this sorting is arbitrary, implementation-specific - /// and subject to change at any time. - /// - None = 0, - - /// - /// Sort the commits in topological order - /// (parents before children); this sorting mode - /// can be combined with time sorting. - /// - Topological = (1 << 0), - - /// - /// Sort the commits by commit time; - /// this sorting mode can be combined with - /// topological sorting. - /// - Time = (1 << 1), - - /// - /// Iterate through the commits in reverse - /// order; this sorting mode can be combined with - /// any of the above. - /// - Reverse = (1 << 2) - } } diff --git a/src/GitVersion.Core/Git/CommitSortStrategies.cs b/src/GitVersion.Core/Git/CommitSortStrategies.cs new file mode 100644 index 0000000000..0c1fc7d0bb --- /dev/null +++ b/src/GitVersion.Core/Git/CommitSortStrategies.cs @@ -0,0 +1,36 @@ +using System; + +namespace GitVersion +{ + [Flags] + public enum CommitSortStrategies + { + /// + /// Sort the commits in no particular ordering; + /// this sorting is arbitrary, implementation-specific + /// and subject to change at any time. + /// + None = 0, + + /// + /// Sort the commits in topological order + /// (parents before children); this sorting mode + /// can be combined with time sorting. + /// + Topological = 1 << 0, + + /// + /// Sort the commits by commit time; + /// this sorting mode can be combined with + /// topological sorting. + /// + Time = 1 << 1, + + /// + /// Iterate through the commits in reverse + /// order; this sorting mode can be combined with + /// any of the above. + /// + Reverse = 1 << 2 + } +} From 49e9adada30d9ccf008a946424180cb11d12d1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Tue, 27 Apr 2021 16:07:58 +0200 Subject: [PATCH 12/13] Move VersionField to its own file --- .../SemanticVersioning/SemanticVersion.cs | 8 -------- .../SemanticVersioning/VersionField.cs | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 src/GitVersion.Core/VersionCalculation/SemanticVersioning/VersionField.cs diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs index 65494749ed..501b1ebe0a 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs @@ -323,12 +323,4 @@ public SemanticVersion IncrementVersion(VersionField incrementStrategy) return incremented; } } - - public enum VersionField - { - None, - Patch, - Minor, - Major - } } diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/VersionField.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/VersionField.cs new file mode 100644 index 0000000000..ed359bd8cc --- /dev/null +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/VersionField.cs @@ -0,0 +1,10 @@ +namespace GitVersion +{ + public enum VersionField + { + None, + Patch, + Minor, + Major + } +} From bb5c74b3e84b365073ca928f529f7d2fe9d1893e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Ulsberg?= Date: Sat, 1 May 2021 03:20:38 +0200 Subject: [PATCH 13/13] Clean the tools directory on teardown --- build.cake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.cake b/build.cake index 70e7662fe1..9866d6e353 100644 --- a/build.cake +++ b/build.cake @@ -104,12 +104,18 @@ Teardown((context, parameters) => { Information("Starting Teardown..."); - Information("Repository info : IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}, IsPullRequest: {3}", + Information("Repository info: IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}, IsPullRequest: {3}", parameters.IsMainRepo, parameters.IsMainBranch, parameters.IsTagged, parameters.IsPullRequest); + var toolsPath = context.Configuration.GetToolPath(context.Environment.WorkingDirectory, context.Environment); + + Information("Tools Path: {0}", toolsPath); + + CleanDirectories(toolsPath.ToString()); + Information("Finished running tasks."); } catch (Exception exception)