diff --git a/vs-commitizen.Settings/vs-commitizen.Settings.csproj b/vs-commitizen.Settings/vs-commitizen.Settings.csproj index 0b0d064..586777a 100644 --- a/vs-commitizen.Settings/vs-commitizen.Settings.csproj +++ b/vs-commitizen.Settings/vs-commitizen.Settings.csproj @@ -672,7 +672,7 @@ - + True @@ -1297,7 +1297,7 @@ - + ..\packages\common\Newtonsoft.Json\lib\netstandard1.3\Newtonsoft.Json.dll @@ -1306,7 +1306,7 @@ - + ..\packages\common\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll @@ -1357,7 +1357,7 @@ - + ..\packages\common\StructureMap\lib\netstandard1.5\StructureMap.dll @@ -1366,7 +1366,7 @@ - + ..\packages\common\StructureMap\lib\netstandard2.0\StructureMap.dll @@ -1467,7 +1467,7 @@ - + ..\packages\common\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll @@ -2506,7 +2506,7 @@ - + ..\packages\common\System.Runtime.Loader\lib\netstandard1.5\System.Runtime.Loader.dll @@ -2844,7 +2844,7 @@ - + ..\packages\common\System.Threading\lib\netstandard1.3\System.Threading.dll diff --git a/vs-commitizen.Shared/Controls/TextBoxWithHint.xaml b/vs-commitizen.Shared/Controls/TextBoxWithHint.xaml index f8593ac..1a53bc7 100644 --- a/vs-commitizen.Shared/Controls/TextBoxWithHint.xaml +++ b/vs-commitizen.Shared/Controls/TextBoxWithHint.xaml @@ -15,7 +15,7 @@ Foreground="LightSteelBlue" Visibility="{Binding ElementName=txtInputBox, Path=Text.IsEmpty, Converter={StaticResource MyBoolToVisibilityConverter}}" HorizontalAlignment="Stretch" - VerticalAlignment="Center" /> + VerticalAlignment="Top" /> + { + _ = LoadCommitTypesAsync(configFileProvider).ConfigureAwait(true); + }; + + this.init = true; + } + } + + private async Task LoadCommitTypesAsync(IConfigFileProvider configFileProvider) { try { @@ -185,7 +219,7 @@ private async Task LoadCommitTypesAsync(IConfigFileProvider configFileProvider) } catch { - this.CommitTypes = new List + this.CommitTypes = new List { new CommitType("feat", "A new feature"), new CommitType("fix", "A bug fix"), diff --git a/vs-commitizen.Tests/packages.config b/vs-commitizen.Tests/packages.config new file mode 100644 index 0000000..341671e --- /dev/null +++ b/vs-commitizen.Tests/packages.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vs-commitizen.Tests/vs-commitizen.Tests.csproj b/vs-commitizen.Tests/vs-commitizen.Tests.csproj index f2355e8..f24b144 100644 --- a/vs-commitizen.Tests/vs-commitizen.Tests.csproj +++ b/vs-commitizen.Tests/vs-commitizen.Tests.csproj @@ -98,7 +98,7 @@ <__paket__xunit_runner_visualstudio_props>net20\xunit.runner.visualstudio - + <__paket__xunit_runner_visualstudio_props>netcoreapp1.0\xunit.runner.visualstudio @@ -112,7 +112,7 @@ - + <__paket__NETStandard_Library_targets>netstandard2.0\NETStandard.Library @@ -124,7 +124,7 @@ <__paket__Microsoft_TestPlatform_TestHost_props>netcoreapp1.0\Microsoft.TestPlatform.TestHost - + <__paket__Microsoft_TestPlatform_TestHost_props>netcoreapp2.1\Microsoft.TestPlatform.TestHost @@ -138,7 +138,7 @@ <__paket__Microsoft_NET_Test_Sdk_targets>netcoreapp1.0\Microsoft.NET.Test.Sdk - + <__paket__Microsoft_NET_Test_Sdk_props>netcoreapp2.1\Microsoft.NET.Test.Sdk <__paket__Microsoft_NET_Test_Sdk_targets>netcoreapp2.1\Microsoft.NET.Test.Sdk @@ -147,7 +147,7 @@ - + <__paket__Microsoft_CodeCoverage_props>netstandard1.0\Microsoft.CodeCoverage <__paket__Microsoft_CodeCoverage_targets>netstandard1.0\Microsoft.CodeCoverage @@ -188,7 +188,7 @@ - + ..\packages\tests\AutoFixture\lib\netstandard1.5\AutoFixture.dll @@ -197,7 +197,7 @@ - + ..\packages\tests\AutoFixture\lib\netstandard2.0\AutoFixture.dll @@ -217,7 +217,7 @@ - + ..\packages\tests\AutoFixture.AutoNSubstitute\lib\netstandard1.5\AutoFixture.AutoNSubstitute.dll @@ -226,7 +226,7 @@ - + ..\packages\tests\AutoFixture.AutoNSubstitute\lib\netstandard2.0\AutoFixture.AutoNSubstitute.dll @@ -246,7 +246,7 @@ - + ..\packages\tests\AutoFixture.Xunit2\lib\netstandard1.5\AutoFixture.Xunit2.dll @@ -255,7 +255,7 @@ - + ..\packages\tests\AutoFixture.Xunit2\lib\netstandard2.0\AutoFixture.Xunit2.dll @@ -298,7 +298,7 @@ - + ..\packages\tests\Castle.Core\lib\netstandard1.5\Castle.Core.dll @@ -376,7 +376,7 @@ - + ..\packages\tests\Fare\lib\netstandard1.1\Fare.dll @@ -467,7 +467,7 @@ - + ..\packages\tests\Microsoft.CodeCoverage.16.9.4\lib\netcoreapp1.0\Microsoft.VisualStudio.CodeCoverage.Shim.dll @@ -478,7 +478,7 @@ - + True @@ -535,28 +535,28 @@ - + True - + True - + True - + True @@ -1058,7 +1058,7 @@ - + ..\packages\tests\Microsoft.TestPlatform.ObjectModel.16.9.4\lib\netstandard1.3\Microsoft.TestPlatform.CoreUtilities.dll @@ -1077,7 +1077,7 @@ - + ..\packages\tests\Microsoft.TestPlatform.ObjectModel.16.9.4\lib\netstandard2.0\Microsoft.TestPlatform.CoreUtilities.dll @@ -1152,7 +1152,7 @@ - + ..\packages\tests\Microsoft.TestPlatform.TestHost.16.9.4\lib\netcoreapp2.1\Microsoft.TestPlatform.CommunicationUtilities.dll @@ -1514,7 +1514,7 @@ - + True @@ -2211,7 +2211,7 @@ - + ..\packages\tests\Newtonsoft.Json\lib\netstandard1.3\Newtonsoft.Json.dll @@ -2220,7 +2220,7 @@ - + ..\packages\tests\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll @@ -2261,7 +2261,7 @@ - + ..\packages\tests\NSubstitute\lib\netstandard1.3\NSubstitute.dll @@ -2270,7 +2270,7 @@ - + ..\packages\tests\NSubstitute\lib\netstandard2.0\NSubstitute.dll @@ -2319,7 +2319,7 @@ - + ..\packages\tests\Shouldly\lib\netstandard1.3\Shouldly.dll @@ -2328,7 +2328,7 @@ - + ..\packages\tests\Shouldly\lib\netstandard2.0\Shouldly.dll @@ -2379,7 +2379,7 @@ - + ..\packages\tests\StructureMap\lib\netstandard1.5\StructureMap.dll @@ -2388,7 +2388,7 @@ - + ..\packages\tests\StructureMap\lib\netstandard2.0\StructureMap.dll @@ -2480,7 +2480,7 @@ - + ..\packages\tests\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll @@ -2520,7 +2520,7 @@ - + ..\packages\tests\System.Collections.NonGeneric\lib\netstandard1.3\System.Collections.NonGeneric.dll @@ -2540,7 +2540,7 @@ - + ..\packages\tests\System.Collections.Specialized\lib\netstandard1.3\System.Collections.Specialized.dll @@ -2569,7 +2569,7 @@ - + ..\packages\tests\System.ComponentModel\lib\netstandard1.3\System.ComponentModel.dll @@ -2616,7 +2616,7 @@ - + ..\packages\tests\System.ComponentModel.Annotations\lib\netstandard2.1\System.ComponentModel.Annotations.dll @@ -2694,7 +2694,7 @@ - + ..\packages\tests\System.ComponentModel.TypeConverter\lib\netstandard1.5\System.ComponentModel.TypeConverter.dll @@ -2849,7 +2849,7 @@ - + ..\packages\tests\System.Dynamic.Runtime\lib\netstandard1.3\System.Dynamic.Runtime.dll @@ -3061,7 +3061,7 @@ - + ..\packages\tests\System.Linq\lib\netstandard1.6\System.Linq.dll @@ -3090,7 +3090,7 @@ - + ..\packages\tests\System.Linq.Expressions\lib\netstandard1.6\System.Linq.Expressions.dll @@ -3208,7 +3208,7 @@ - + ..\packages\tests\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll @@ -3402,7 +3402,7 @@ - + ..\packages\tests\System.Reflection.Metadata\lib\netstandard1.1\System.Reflection.Metadata.dll @@ -3411,7 +3411,7 @@ - + ..\packages\tests\System.Reflection.Metadata\lib\netstandard2.0\System.Reflection.Metadata.dll @@ -3592,7 +3592,7 @@ - + ..\packages\tests\System.Runtime.CompilerServices.Unsafe\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll @@ -3710,7 +3710,7 @@ - + ..\packages\tests\System.Runtime.Loader\lib\netstandard1.5\System.Runtime.Loader.dll @@ -4032,7 +4032,7 @@ - + ..\packages\tests\System.Threading\lib\netstandard1.3\System.Threading.dll @@ -4205,7 +4205,7 @@ - + ..\packages\tests\System.Xml.XmlDocument\lib\netstandard1.3\System.Xml.XmlDocument.dll @@ -4415,7 +4415,7 @@ - + ..\packages\tests\xunit.abstractions\lib\netstandard1.0\xunit.abstractions.dll @@ -4424,7 +4424,7 @@ - + ..\packages\tests\xunit.abstractions\lib\netstandard2.0\xunit.abstractions.dll @@ -4441,7 +4441,7 @@ - + ..\packages\tests\xunit.assert\lib\netstandard1.1\xunit.assert.dll @@ -4452,7 +4452,7 @@ - + ..\packages\tests\xunit.extensibility.core\lib\netstandard1.1\xunit.core.dll @@ -4472,7 +4472,7 @@ - + ..\packages\tests\xunit.extensibility.execution\lib\netstandard1.1\xunit.execution.dotnet.dll @@ -4519,7 +4519,7 @@ - + ..\packages\tests\Xunit.StaFact\lib\netstandard1.1\Xunit.StaFact.dll diff --git a/vs-commitizen/Infrastructure/ConfigFileProvider.cs b/vs-commitizen/Infrastructure/ConfigFileProvider.cs index cd32540..2e3ff4c 100644 --- a/vs-commitizen/Infrastructure/ConfigFileProvider.cs +++ b/vs-commitizen/Infrastructure/ConfigFileProvider.cs @@ -44,7 +44,7 @@ public async Task> GetCommitTypesAsync() where T : class lock (@lock) { var commitTypes = cache.GetCacheItem(cacheKey); - if (commitTypes != null) return (IList)commitTypes.Value; + // if (commitTypes != null) return (IList)commitTypes.Value; } try diff --git a/vs-commitizen/Infrastructure/FileAccessor.cs b/vs-commitizen/Infrastructure/FileAccessor.cs index 3eb6cab..7076dca 100644 --- a/vs-commitizen/Infrastructure/FileAccessor.cs +++ b/vs-commitizen/Infrastructure/FileAccessor.cs @@ -38,38 +38,36 @@ public virtual StreamWriter CreateText(string filePath) public virtual string ReadFile(string filePath) { - return File.ReadAllText(filePath); + return File.ReadAllText(filePath, Encoding.UTF8); } public virtual string[] ReadFileLines(string filePath) { - return File.ReadAllLines(filePath); + return File.ReadAllLines(filePath, Encoding.UTF8); } public virtual async Task ReadFileAsync(string filePath) { using (var file = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, true)) + using (var reader = new StreamReader(file, Encoding.UTF8)) { - var buff = new byte[file.Length]; - await file.ReadAsync(buff, 0, (int)file.Length); - return Encoding.Default.GetString(buff); + return await reader.ReadToEndAsync(); } } public virtual async Task WriteFileAsync(string filePath, string content) { - var encodedText = Encoding.Default.GetBytes(content); - using (var sourceStream = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.None, 4096, true)) + using (var writer = new StreamWriter(sourceStream, Encoding.UTF8)) { - await sourceStream.WriteAsync(encodedText, 0, encodedText.Length); - }; + await writer.WriteAsync(content); + } } public virtual void WriteFile(string filePath, string content) { - File.WriteAllText(filePath, content); + File.WriteAllText(filePath, content, Encoding.UTF8); } public virtual FileAttributes GetAttributes(string filePath) diff --git a/vs-commitizen/Properties/AssemblyInfo.cs b/vs-commitizen/Properties/AssemblyInfo.cs index 90d0342..74c845e 100644 --- a/vs-commitizen/Properties/AssemblyInfo.cs +++ b/vs-commitizen/Properties/AssemblyInfo.cs @@ -29,6 +29,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.2")] +[assembly: AssemblyFileVersion("1.0.1.2")] [assembly: InternalsVisibleTo("vs-commitizen.Tests")] \ No newline at end of file diff --git a/vs-commitizen/app.config b/vs-commitizen/app.config index 9b16146..00a3427 100644 --- a/vs-commitizen/app.config +++ b/vs-commitizen/app.config @@ -1,4 +1,4 @@ - + diff --git a/vs-commitizen/defaultConfigFile.json b/vs-commitizen/defaultConfigFile.json index 4bb1480..19709aa 100644 --- a/vs-commitizen/defaultConfigFile.json +++ b/vs-commitizen/defaultConfigFile.json @@ -1,49 +1,45 @@ { - "$schema": "https://raw.githubusercontent.com/MrLuje/vs-commitizen/master/config-schema.json", - "types": [ - { - "type": "feat", - "description": "A new feature" - }, - { - "type": "fix", - "description": "A bug fix" - }, - { - "type": "docs", - "description": "Documentation only changes" - }, - { - "type": "style", - "description": "Changes that do not affect the meaning of the code (formatting, etc)" - }, - { - "type": "refactor", - "description": "A code change that neither fixes a bug nor adds a feature" - }, - { - "type": "perf", - "description": "A code change that improves performance" - }, - { - "type": "test", - "description": "Adding missing tests or correcting existing tests" - }, - { - "type": "build", - "description": "Changes that affect the build system or external dependencies (example scopes: gulp, etc)" - }, - { - "type": "ci", - "description": "Changes to our CI configuration files and scripts (example scopes: Travis, etc)" - }, - { - "type": "chore", - "description": "Other changes that don't modify src or test files" - }, - { - "type": "revert", - "description": "Reverts a previous commit" - } - ] + "$schema": "https://raw.githubusercontent.com/MrLuje/vs-commitizen/master/config-schema.json", + "types": [ + { + "type": "✨feat", + "description": "Select when creating new things" + }, + { + "type": "🐞fix", + "description": "Select when fixing a bug" + }, + { + "type": "📄docs", + "description": "Select when editing documentation" + }, + { + "type": "🚀ci", + "description": "Select when editing CI scripts" + }, + { + "type": "🖥️build", + "description": "Select when concerning build change or external dependencies" + }, + { + "type": "⚙️refactor", + "description": "Select when no new performances or no new functionnality" + }, + { + "type": "🌈style", + "description": "Select when working on code style" + }, + { + "type": "⚡perf", + "description": "Select when working on performances" + }, + { + "type": "⏪revert", + "description": "Select when going back" + }, + { + "type": "🔵test", + "description": "Select when adding or editing tests" + } + ] } \ No newline at end of file diff --git a/vs-commitizen/vs-commitizen.csproj b/vs-commitizen/vs-commitizen.csproj index 0fb8287..50f2064 100644 --- a/vs-commitizen/vs-commitizen.csproj +++ b/vs-commitizen/vs-commitizen.csproj @@ -848,7 +848,7 @@ - + True @@ -1485,7 +1485,7 @@ - + ..\packages\common\Newtonsoft.Json\lib\netstandard1.3\Newtonsoft.Json.dll @@ -1494,7 +1494,7 @@ - + ..\packages\common\Newtonsoft.Json\lib\netstandard2.0\Newtonsoft.Json.dll @@ -1534,7 +1534,7 @@ - + ..\packages\common\StructureMap\lib\netstandard1.5\StructureMap.dll @@ -1543,7 +1543,7 @@ - + ..\packages\common\StructureMap\lib\netstandard2.0\StructureMap.dll @@ -1644,7 +1644,7 @@ - + ..\packages\common\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll @@ -2683,7 +2683,7 @@ - + ..\packages\common\System.Runtime.Loader\lib\netstandard1.5\System.Runtime.Loader.dll @@ -3021,7 +3021,7 @@ - + ..\packages\common\System.Threading\lib\netstandard1.3\System.Threading.dll