From 363408e349268e643f4fd92beb1bf4b23ca4b169 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sat, 14 Jan 2023 13:35:42 +0100 Subject: [PATCH] Make sure, that `HasSourceChanges` is the opposite of `HasDocumentationChanges` --- Build/Build.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index a220d0cb01..b661c04cc2 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -286,16 +286,16 @@ class Build : NukeBuild customLogger: (_, msg) => Error(msg)); }); - bool HasDocumentationChanges => - Changes.Any(x => - x.StartsWith("docs") || - x.StartsWith("CONTRIBUTING.md") || - x.StartsWith("cSpell.json") || - x.StartsWith("LICENSE") || - x.StartsWith("README.md")); - - bool HasSourceChanges => - Changes.Any(x => !x.StartsWith("docs")); + bool HasDocumentationChanges => Changes.Any(x => IsDocumentation(x)); + + bool HasSourceChanges => Changes.Any(x => !IsDocumentation(x)); + + static bool IsDocumentation(string x) => + x.StartsWith("docs") || + x.StartsWith("CONTRIBUTING.md") || + x.StartsWith("cSpell.json") || + x.StartsWith("LICENSE") || + x.StartsWith("README.md"); string[] Changes => Repository.Diff