From ad3f51304f7e80f5d5b433c6897dc45113b6f505 Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Sun, 10 Mar 2019 20:04:52 -0700 Subject: [PATCH 1/8] Ignore ReSharper caches. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9985523..0a5f925 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ Thumbs.db *.ncrunchproject *.ncrunchsolution nCrunchTemp* +_ReSharper* From 8bb50461fc801e2a666de6f0a42825f12b47bff1 Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Mon, 11 Mar 2019 08:14:27 -0700 Subject: [PATCH 2/8] Remove tests, source link, docs generation. --- .travis.yml | 2 +- FindReplaceCode.sln | 71 +++++++++---------- build.cake | 63 ++-------------- src/Directory.Build.props | 5 -- src/FindReplaceCode/App.config | 8 +-- .../Properties/Settings.Designer.cs | 50 ++++++------- .../Properties/Settings.settings | 4 +- .../FindReplaceCode.Tests.csproj | 18 ----- 8 files changed, 69 insertions(+), 152 deletions(-) delete mode 100644 tests/FindReplaceCode.Tests/FindReplaceCode.Tests.csproj diff --git a/.travis.yml b/.travis.yml index 9d08722..6c5c048 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,4 @@ dist: trusty sudo: false script: -- ./build.sh --target=NuGetPackageTest +- ./build.sh --target=NuGetPackage diff --git a/FindReplaceCode.sln b/FindReplaceCode.sln index 1c49fab..18ca383 100644 --- a/FindReplaceCode.sln +++ b/FindReplaceCode.sln @@ -1,46 +1,41 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.28010.2003 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C0F6A102-92D4-4054-84BF-00D9A313577D}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .gitattributes = .gitattributes - .gitignore = .gitignore - .travis.yml = .travis.yml - appveyor.yml = appveyor.yml - build.cake = build.cake - build.ps1 = build.ps1 - CONTRIBUTING.md = CONTRIBUTING.md - LICENSE = LICENSE - README.md = README.md - VersionHistory.md = VersionHistory.md - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FindReplaceCode", "src\FindReplaceCode\FindReplaceCode.csproj", "{4E2B87C2-B50A-4876-A1EC-118554B4B389}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FindReplaceCode", "src\FindReplaceCode\FindReplaceCode.csproj", "{4E2B87C2-B50A-4876-A1EC-118554B4B389}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FindReplaceCode.Tests", "tests\FindReplaceCode.Tests\FindReplaceCode.Tests.csproj", "{DF559AD1-5287-43B1-AB47-61B6F342B0FE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8C2B8692-C413-4D47-BBC5-046E63526F9D}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitattributes = .gitattributes + .gitignore = .gitignore + .travis.yml = .travis.yml + appveyor.yml = appveyor.yml + build.cake = build.cake + build.ps1 = build.ps1 + build.sh = build.sh + CONTRIBUTING.md = CONTRIBUTING.md + LICENSE = LICENSE + README.md = README.md + VersionHistory.md = VersionHistory.md + EndProjectSection EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Release|Any CPU.Build.0 = Release|Any CPU - {DF559AD1-5287-43B1-AB47-61B6F342B0FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF559AD1-5287-43B1-AB47-61B6F342B0FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF559AD1-5287-43B1-AB47-61B6F342B0FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF559AD1-5287-43B1-AB47-61B6F342B0FE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {61721187-4DC2-4A62-9B7A-93E34B4071E5} - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E2B87C2-B50A-4876-A1EC-118554B4B389}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61721187-4DC2-4A62-9B7A-93E34B4071E5} + SolutionGuid = {C2367BAD-9F87-4BED-8E58-C1D7E5C3FE51} + EndGlobalSection EndGlobal diff --git a/build.cake b/build.cake index d0c8162..ace8b3a 100644 --- a/build.cake +++ b/build.cake @@ -1,5 +1,5 @@ -#addin "Cake.Git" -#addin nuget:?package=Cake.XmlDocMarkdown&version=1.4.1 +#addin Cake.Git +#addin Cake.XmlDocMarkdown&version=1.4.1 using System.Text.RegularExpressions; @@ -10,9 +10,6 @@ var trigger = Argument("trigger", ""); var versionSuffix = Argument("versionSuffix", ""); var solutionFileName = "FindReplaceCode.sln"; -var docsProjects = new[] { "FindReplaceCode" }; -var docsRepoUri = "https://github.com/Faithlife/FindReplaceCode.git"; -var docsSourceUri = "https://github.com/Faithlife/FindReplaceCode/tree/master/src"; var nugetSource = "https://api.nuget.org/v3/index.json"; var buildBotUserName = "faithlifebuildbot"; @@ -23,8 +20,6 @@ Task("Clean") { CleanDirectories("src/**/bin"); CleanDirectories("src/**/obj"); - CleanDirectories("tests/**/bin"); - CleanDirectories("tests/**/obj"); CleanDirectories("release"); }); @@ -45,49 +40,8 @@ Task("Rebuild") .IsDependentOn("Clean") .IsDependentOn("Build"); -Task("UpdateDocs") - .WithCriteria(!string.IsNullOrEmpty(buildBotPassword)) - .WithCriteria(EnvironmentVariable("APPVEYOR_REPO_BRANCH") == "master") - .IsDependentOn("Build") - .Does(() => - { - var branchName = "gh-pages"; - var docsDirectory = new DirectoryPath(branchName); - GitClone(docsRepoUri, docsDirectory, new GitCloneSettings { BranchName = branchName }); - - Information($"Updating documentation at {docsDirectory}."); - foreach (var docsProject in docsProjects) - { - XmlDocMarkdownGenerate(File($"src/{docsProject}/bin/{configuration}/net461/{docsProject}.dll").ToString(), $"{docsDirectory}{System.IO.Path.DirectorySeparatorChar}", - new XmlDocMarkdownSettings { SourceCodePath = $"{docsSourceUri}/{docsProject}", NewLine = "\n", ShouldClean = true }); - } - - if (GitHasUncommitedChanges(docsDirectory)) - { - Information("Committing all documentation changes."); - GitAddAll(docsDirectory); - GitCommit(docsDirectory, "Faithlife Build Bot", "faithlifebuildbot@users.noreply.github.com", "Automatic documentation update."); - Information("Pushing updated documentation to GitHub."); - GitPush(docsDirectory, buildBotUserName, buildBotPassword, branchName); - } - else - { - Information("No documentation changes detected."); - } - }); - -Task("Test") - .IsDependentOn("Build") - .Does(() => - { - foreach (var projectPath in GetFiles("tests/**/*.csproj").Select(x => x.FullPath)) - DotNetCoreTest(projectPath, new DotNetCoreTestSettings { Configuration = configuration, NoBuild = true, NoRestore = true }); - }); - Task("NuGetPackage") .IsDependentOn("Rebuild") - .IsDependentOn("Test") - .IsDependentOn("UpdateDocs") .Does(() => { if (string.IsNullOrEmpty(versionSuffix) && !string.IsNullOrEmpty(trigger)) @@ -96,17 +50,8 @@ Task("NuGetPackage") DotNetCorePack(projectPath, new DotNetCorePackSettings { Configuration = configuration, NoBuild = true, NoRestore = true, OutputDirectory = "release", VersionSuffix = versionSuffix }); }); -Task("NuGetPackageTest") - .IsDependentOn("NuGetPackage") - .Does(() => - { - var firstProject = GetFiles("src/**/*.csproj").First().FullPath; - foreach (var nupkg in GetFiles("release/**/*.nupkg").Select(x => x.FullPath)) - DotNetCoreTool(firstProject, "sourcelink", $"test {nupkg}"); - }); - Task("NuGetPublish") - .IsDependentOn("NuGetPackageTest") + .IsDependentOn("NuGetPackage") .Does(() => { var nupkgPaths = GetFiles("release/*.nupkg").Select(x => x.FullPath).ToList(); @@ -137,7 +82,7 @@ Task("NuGetPublish") }); Task("Default") - .IsDependentOn("Test"); + .IsDependentOn("Build"); void ExecuteProcess(string exePath, string arguments) { diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 8f697f5..48aefe8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -21,9 +21,4 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - - - - - diff --git a/src/FindReplaceCode/App.config b/src/FindReplaceCode/App.config index 52d31c4..cb4ae4c 100644 --- a/src/FindReplaceCode/App.config +++ b/src/FindReplaceCode/App.config @@ -10,9 +10,9 @@ - - asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,props,proto,ps1,settings,sln,xaml,yml - - + + asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,props,proto,ps1,settings,sln,xaml,yml + + diff --git a/src/FindReplaceCode/Properties/Settings.Designer.cs b/src/FindReplaceCode/Properties/Settings.Designer.cs index 1eebe4c..3b7b23b 100644 --- a/src/FindReplaceCode/Properties/Settings.Designer.cs +++ b/src/FindReplaceCode/Properties/Settings.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -9,28 +9,28 @@ //------------------------------------------------------------------------------ namespace FindReplaceCode.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.3.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,proto,ps1,settings,sln,xaml,ym" + - "l")] - public string FindReplaceFileContentExtensions { - get { - return ((string)(this["FindReplaceFileContentExtensions"])); - } - } - } + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,proto,ps1,settings,sln,xaml,ym" + + "l")] + public string FindReplaceFileContentExtensions { + get { + return ((string)(this["FindReplaceFileContentExtensions"])); + } + } + } } diff --git a/src/FindReplaceCode/Properties/Settings.settings b/src/FindReplaceCode/Properties/Settings.settings index 8a34584..51246b3 100644 --- a/src/FindReplaceCode/Properties/Settings.settings +++ b/src/FindReplaceCode/Properties/Settings.settings @@ -3,7 +3,7 @@ - asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,proto,ps1,settings,sln,xaml,yml + asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,props,proto,ps1,settings,sln,xaml,yml - + \ No newline at end of file diff --git a/tests/FindReplaceCode.Tests/FindReplaceCode.Tests.csproj b/tests/FindReplaceCode.Tests/FindReplaceCode.Tests.csproj deleted file mode 100644 index 8618d53..0000000 --- a/tests/FindReplaceCode.Tests/FindReplaceCode.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netcoreapp2.1 - latest - - - - - - - - - - - - - \ No newline at end of file From fa48035a6956dcc3932d233a2c6a709f72fa75fe Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Sun, 10 Mar 2019 20:51:05 -0700 Subject: [PATCH 3/8] Stop using poorly-supported Settings.settings. --- src/FindReplaceCode/App.config | 18 ---------- src/FindReplaceCode/FindReplaceCode.csproj | 16 --------- src/FindReplaceCode/Program.cs | 23 ++++++++++-- .../Properties/Settings.Designer.cs | 36 ------------------- .../Properties/Settings.settings | 9 ----- 5 files changed, 20 insertions(+), 82 deletions(-) delete mode 100644 src/FindReplaceCode/App.config delete mode 100644 src/FindReplaceCode/Properties/Settings.Designer.cs delete mode 100644 src/FindReplaceCode/Properties/Settings.settings diff --git a/src/FindReplaceCode/App.config b/src/FindReplaceCode/App.config deleted file mode 100644 index cb4ae4c..0000000 --- a/src/FindReplaceCode/App.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - -
- - - - - - - - - asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,props,proto,ps1,settings,sln,xaml,yml - - - - diff --git a/src/FindReplaceCode/FindReplaceCode.csproj b/src/FindReplaceCode/FindReplaceCode.csproj index cf478f0..7f8186a 100644 --- a/src/FindReplaceCode/FindReplaceCode.csproj +++ b/src/FindReplaceCode/FindReplaceCode.csproj @@ -7,20 +7,4 @@ findreplacecode Faithlife.FindReplaceCode.Tool - - - True - True - Settings.settings - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - \ No newline at end of file diff --git a/src/FindReplaceCode/Program.cs b/src/FindReplaceCode/Program.cs index b923d1b..9ef7311 100644 --- a/src/FindReplaceCode/Program.cs +++ b/src/FindReplaceCode/Program.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Text; using System.Text.RegularExpressions; -using FindReplaceCode.Properties; namespace FindReplaceCode { @@ -294,8 +293,26 @@ private static string RenderMatchingGuid(Match match, Guid value) "Usage: FindReplaceCode.exe [ ...]" }); - static readonly HashSet s_findReplaceFileContentExtensions = - new HashSet(Settings.Default.FindReplaceFileContentExtensions.Split(',').Select(x => "." + x.Trim())); + private static readonly HashSet s_findReplaceFileContentExtensions = new HashSet + { + ".asax", + ".cake", + ".config", + ".cs", + ".csproj", + ".fsd", + ".html", + ".json", + ".md", + ".nuspec", + ".props", + ".proto", + ".ps1", + ".settings", + ".sln", + ".xaml", + ".yml", + }; static readonly Regex s_hiddenDirectoryRegex = new Regex(@"[\\/]\..*[\\/]", RegexOptions.CultureInvariant); diff --git a/src/FindReplaceCode/Properties/Settings.Designer.cs b/src/FindReplaceCode/Properties/Settings.Designer.cs deleted file mode 100644 index 3b7b23b..0000000 --- a/src/FindReplaceCode/Properties/Settings.Designer.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace FindReplaceCode.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.ApplicationScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,proto,ps1,settings,sln,xaml,ym" + - "l")] - public string FindReplaceFileContentExtensions { - get { - return ((string)(this["FindReplaceFileContentExtensions"])); - } - } - } -} diff --git a/src/FindReplaceCode/Properties/Settings.settings b/src/FindReplaceCode/Properties/Settings.settings deleted file mode 100644 index 51246b3..0000000 --- a/src/FindReplaceCode/Properties/Settings.settings +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - asax,cake,config,cs,csproj,fsd,html,json,md,nuspec,props,proto,ps1,settings,sln,xaml,yml - - - \ No newline at end of file From bd10b9123706778f925c9cda5a7796a7ae2fca2a Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Mon, 11 Mar 2019 08:02:32 -0700 Subject: [PATCH 4/8] Add private keyword. --- src/FindReplaceCode/Program.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/FindReplaceCode/Program.cs b/src/FindReplaceCode/Program.cs index 9ef7311..4fd8f0d 100644 --- a/src/FindReplaceCode/Program.cs +++ b/src/FindReplaceCode/Program.cs @@ -286,9 +286,9 @@ private static string RenderMatchingGuid(Match match, Guid value) return oldText != oldText.ToUpperInvariant() ? newText : newText.ToUpperInvariant(); } - const string c_guidPattern = @"\{[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}\}"; + private const string c_guidPattern = @"\{[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}\}"; - static readonly string s_fullUsageMessage = string.Join(Environment.NewLine, new[] + private static readonly string s_fullUsageMessage = string.Join(Environment.NewLine, new[] { "Usage: FindReplaceCode.exe [ ...]" }); @@ -314,13 +314,13 @@ private static string RenderMatchingGuid(Match match, Guid value) ".yml", }; - static readonly Regex s_hiddenDirectoryRegex = new Regex(@"[\\/]\..*[\\/]", RegexOptions.CultureInvariant); + private static readonly Regex s_hiddenDirectoryRegex = new Regex(@"[\\/]\..*[\\/]", RegexOptions.CultureInvariant); - readonly string m_folderPath; - readonly ReadOnlyCollection> m_searchReplaceArgs; - List> m_searchReplacePairs; - List> m_searchReplaceGuids; - int m_editCount; - int m_renameCount; + private readonly string m_folderPath; + private readonly ReadOnlyCollection> m_searchReplaceArgs; + private List> m_searchReplacePairs; + private List> m_searchReplaceGuids; + private int m_editCount; + private int m_renameCount; } } From 37bc6182443a261dcb9e687e944b2f853f1b4e1b Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Mon, 11 Mar 2019 08:08:27 -0700 Subject: [PATCH 5/8] Move supported extensions into their own file. --- README.md | 3 +-- src/FindReplaceCode/Program.cs | 23 +-------------------- src/FindReplaceCode/ProgramSettings.cs | 28 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 src/FindReplaceCode/ProgramSettings.cs diff --git a/README.md b/README.md index b728833..e50ed44 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Any subfolder whose name starts with a period (e.g. `.git`) is automatically exc ## Issues -Only [certain file extensions](src/FindReplaceCode/App.config) are currently considered for content replacement. Please let us know if there are others that should be added. +Only [certain file extensions](src/FindReplaceCode/ProgramSettings.cs) are currently considered for content replacement. Please let us know if there are others that should be added. ## Build Status @@ -52,7 +52,6 @@ Ubuntu | Windows | NuGet ## Documentation -* https://faithlife.github.io/FindReplaceCode/ * License: [MIT](LICENSE) * [Version History](VersionHistory.md) * [Contributing Guidelines](CONTRIBUTING.md) diff --git a/src/FindReplaceCode/Program.cs b/src/FindReplaceCode/Program.cs index 4fd8f0d..65e5ea3 100644 --- a/src/FindReplaceCode/Program.cs +++ b/src/FindReplaceCode/Program.cs @@ -255,7 +255,7 @@ private static bool ShouldFindReplaceFileContent(FileSystemInfo info) return false; string extension = Path.GetExtension(info.Name).ToLowerInvariant(); - return s_findReplaceFileContentExtensions.Contains(extension); + return ProgramSettings.FindReplaceFileContentExtensions.Contains(extension); } private string ReplaceStrings(string oldText) @@ -293,27 +293,6 @@ private static string RenderMatchingGuid(Match match, Guid value) "Usage: FindReplaceCode.exe [ ...]" }); - private static readonly HashSet s_findReplaceFileContentExtensions = new HashSet - { - ".asax", - ".cake", - ".config", - ".cs", - ".csproj", - ".fsd", - ".html", - ".json", - ".md", - ".nuspec", - ".props", - ".proto", - ".ps1", - ".settings", - ".sln", - ".xaml", - ".yml", - }; - private static readonly Regex s_hiddenDirectoryRegex = new Regex(@"[\\/]\..*[\\/]", RegexOptions.CultureInvariant); private readonly string m_folderPath; diff --git a/src/FindReplaceCode/ProgramSettings.cs b/src/FindReplaceCode/ProgramSettings.cs new file mode 100644 index 0000000..55b12a6 --- /dev/null +++ b/src/FindReplaceCode/ProgramSettings.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace FindReplaceCode +{ + public sealed class ProgramSettings + { + public static readonly IReadOnlyCollection FindReplaceFileContentExtensions = new HashSet + { + ".asax", + ".cake", + ".config", + ".cs", + ".csproj", + ".fsd", + ".html", + ".json", + ".md", + ".nuspec", + ".props", + ".proto", + ".ps1", + ".settings", + ".sln", + ".xaml", + ".yml", + }; + } +} From 245eae08296d87ddfcf61e468f04f5b3640dd9ea Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Mon, 11 Mar 2019 08:08:03 -0700 Subject: [PATCH 6/8] Initial release is 1.0.0. --- VersionHistory.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VersionHistory.md b/VersionHistory.md index ce33c33..3207e93 100644 --- a/VersionHistory.md +++ b/VersionHistory.md @@ -9,6 +9,6 @@ Prefix the description of the change with `[major]`, `[minor]` or `[patch]` in a ## Released -### 0.1.0 +### 1.0.0 * Initial release. From 6cbff66241b705d5e04cdaa6b2d6380e6e3e4ab7 Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Mon, 11 Mar 2019 08:13:00 -0700 Subject: [PATCH 7/8] Fix NuGet shield in README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e50ed44..11ff144 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Only [certain file extensions](src/FindReplaceCode/ProgramSettings.cs) are curre Ubuntu | Windows | NuGet --- | --- | --- -[![Travis CI](https://img.shields.io/travis/Faithlife/FindReplaceCode/master.svg)](https://travis-ci.org/Faithlife/FindReplaceCode) | [![AppVeyor](https://img.shields.io/appveyor/ci/Faithlife/findreplacecode/master.svg)](https://ci.appveyor.com/project/Faithlife/findreplacecode) | [![NuGet](https://img.shields.io/nuget/v/FindReplaceCode.svg)](https://www.nuget.org/packages/FindReplaceCode) +[![Travis CI](https://img.shields.io/travis/Faithlife/FindReplaceCode/master.svg)](https://travis-ci.org/Faithlife/FindReplaceCode) | [![AppVeyor](https://img.shields.io/appveyor/ci/Faithlife/findreplacecode/master.svg)](https://ci.appveyor.com/project/Faithlife/findreplacecode) | [![NuGet](https://img.shields.io/nuget/v/Faithlife.FindReplaceCode.Tool.svg)](https://www.nuget.org/packages/Faithlife.FindReplaceCode.Tool) ## Documentation From 53aec5faf5840839f507db20b59daba5e378ecab Mon Sep 17 00:00:00 2001 From: Ed Ball Date: Tue, 12 Mar 2019 08:17:03 -0700 Subject: [PATCH 8/8] Change sealed class to static. --- src/FindReplaceCode/ProgramSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FindReplaceCode/ProgramSettings.cs b/src/FindReplaceCode/ProgramSettings.cs index 55b12a6..91b2309 100644 --- a/src/FindReplaceCode/ProgramSettings.cs +++ b/src/FindReplaceCode/ProgramSettings.cs @@ -2,7 +2,7 @@ namespace FindReplaceCode { - public sealed class ProgramSettings + public static class ProgramSettings { public static readonly IReadOnlyCollection FindReplaceFileContentExtensions = new HashSet {