Giter Site home page Giter Site logo

mrluje / vs-commitizen Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 6.0 20.83 MB

This extension adds commitizen support to VisualStudio.

Home Page: https://marketplace.visualstudio.com/items?itemName=mrluje.vs-commitizen

C# 99.72% PowerShell 0.28%
git commitizen conventional-changelog visual-studio-extension

vs-commitizen's Introduction

vs-commitizen

Build status

This extension adds commitizen support to VisualStudio.

(If you are still using "classic git experience" or VisualStudio 2015/2017, you can use the previous integration)

Features

A nice page to format your comment using commitizen fashion (available under View > Other windows > VsCommitizen)

xxx

Customizations

The list of "Type of changes" can be customized, globally or per repository.

The configuration is stored in a .commitizen.json file (schema)

You can access the configuration file directly from VisualStudio menu (files will be generated if not existing yet) :

menu.png

Sample configuration

{
  "$schema": "https://github.com/MrLuje/vs-commitizen/config-schema.json",
  "types": [
    {
      "type": "feat",
      "description": "A new feature"
    },
    {
      "type": "fix",
      "description": "A bug fix"
    },
    {
      "type": "docs",
      "description": "Documentation only changes"
    },
    {
      "type": "test",
      "description": "Adding missing tests or correcting existing tests"
    }
}

Build from source

  • Install paket
dotnet tool install --global Paket
  • Restore nugets dependencies
.\restore.ps1
  • Compile with VisualStudio

Build issues

Could not load file or assembly 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
  • Check that file vs-commitizen.Tests\app.config contains the following redirect
<dependentAssembly>
    <Paket>True</Paket>
    <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.0.0" />
</dependentAssembly>

vs-commitizen's People

Contributors

mrluje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vs-commitizen's Issues

VS 2017 15.7.4 error

Using VS 2017 15.7.4, I've this issue when I click the CommitCz button:

Microsoft.VisualStudio.Composition.CompositionFailedException: An exception was thrown while initializing part "vs_commitizen.vs2015.VsCommitizenSection". ---> StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'vs_commitizen.vs.Settings.IUserSettings'

There is no configuration specified for vs_commitizen.vs.Settings.IUserSettings

1.) new CommitizenViewModel(*Default of IUserSettings*)
2.) vs_commitizen.vs.ViewModels.CommitizenViewModel
3.) Instance of vs_commitizen.vs.ViewModels.CommitizenViewModel
4.) Container.GetInstance<vs_commitizen.vs.ViewModels.CommitizenViewModel>()

   at lambda_method(Closure , IBuildSession , IContext )
   at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context)
   at StructureMap.BuildSession.BuildNewInSession(Type pluginType, Instance instance)
   at StructureMap.Pipeline.NulloTransientCache.Get(Type pluginType, Instance instance, IBuildSession session)
   at StructureMap.BuildSession.ResolveFromLifecycle(Type pluginType, Instance instance)
   at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle)
   at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph)
   at StructureMap.Container.GetInstance[T]()
   at vs_commitizen.Settings.IoC.GetInstance[T]()
   at vs_commitizen.vs.VsCommitizenView..ctor()
   at vs_commitizen.vs2015.VsCommitizenSection..ctor()
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass53_0.<CreateExport>b__0()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass55_0.<CreateExportFactoryExport>b__1()
   at Microsoft.VisualStudio.Composition.ExportProvider.<>c__DisplayClass54_0.<CreateExportFactory>b__0()
   at Microsoft.VisualStudio.Composition.DelegateServices.<>c__DisplayClass2_0`1.<As>b__0()
   at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
   at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.ComposablePartDefinitionForExportFactory.CreatePart()
   at System.ComponentModel.Composition.ReflectionModel.ExportFactoryCreator.LifetimeContext.GetExportLifetimeContextFromExport[T](Export export)
   at System.ComponentModel.Composition.ReflectionModel.ExportFactoryCreator.<>c__DisplayClass6_0`2.<CreateStronglyTypedExportFactoryOfTM>b__0()
   at System.ComponentModel.Composition.ExportFactory`1.CreateExport()
   at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerSectionHost.Create()

#12 seems not to be fixed

Commitizen button is no longer visible

In VS 2019 v16.8.x, the Commitizen button no longer appears in the new Git experience's Git Changes window.

image

It's obviously Visual Studio that has broken the existing functionality with its new changes window.

This means that if the new Git experience is active, Commitizen can no longer be used unless a way to incorporate it into the new Git Changes window is found.

Exception: "Object rederence not set to an instance od an object"

Describe the bug
Error opening Changes on TeamExplorer.

Expected behavior
No error on previous version.

Error

System.Windows.Markup.XamlParseException: Could not load file or assembly 'Microsoft.TeamFoundation.Controls, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly bamlAssembly)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
   at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
   at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
   at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
   at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
   at System.Windows.Baml2006.Baml2006Reader.Read()
   at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Microsoft.TeamFoundation.Git.Controls.PendingChanges.GitPendingChangesPageView.InitializeComponent()
   at Microsoft.TeamFoundation.Git.Controls.PendingChanges.GitPendingChangesPageView..ctor()
   at Microsoft.TeamFoundation.Git.Provider.PendingChanges.GitPendingChangesPageVS.CreateView(PageInitializeEventArgs e)
   at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.TeamExplorerPageBase.Initialize(Object sender, PageInitializeEventArgs e)
   at Microsoft.TeamFoundation.Git.Controls.GitTeamExplorerPageBase.Initialize(Object sender, PageInitializeEventArgs e)
   at Microsoft.TeamFoundation.Git.Provider.PendingChanges.GitPendingChangesPageVS.Initialize(Object sender, PageInitializeEventArgs e)
   at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerPageHost.Initialize(TeamExplorerPageContext context)
System.Windows.Markup.XamlParseException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly bamlAssembly)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
   at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
   at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
   at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
   at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
   at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
   at System.Windows.Baml2006.Baml2006Reader.Read()
   at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Microsoft.TeamFoundation.Git.Controls.Stash.StashListSectionView.InitializeComponent()
   at Microsoft.TeamFoundation.Git.Controls.Stash.StashListSectionView..ctor()
   at Microsoft.TeamFoundation.Git.Provider.Stash.StashListSectionVS.CreateView(SectionInitializeEventArgs e)
   at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.TeamExplorerSectionBase.Initialize(Object sender, SectionInitializeEventArgs e)
   at Microsoft.TeamFoundation.Controls.WPF.TeamExplorer.Framework.TeamExplorerSectionHost.Initialize(Object context)

Visual Studio (please complete the following information):

  • Kind community
  • Version 2019 v16.5.4

Missed stash dropdown in VS 2019

Describe the bug
Without extension we have dropdown button to stash changes, like this:
default, but your extension button hide this button.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Changes

Expected behavior
Dropdown with stash + vscommitizen button are visible.

Visual Studio (please complete the following information):

  • community
  • 2019

Does not auto-create directory for "%appdata%\vs-commitizen\.commitizen.json"

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to %appdata%
  2. Ensure "vs-commitizen" folder does not exist.
  3. In the project's repository, ensure a local commitizen config exists. Otherwise, the "Open local configuration file" button will be disabled.
  4. In Visual Studio, go to Extensions > vs-commitizen and select "Open local configuration file".
  5. See error

Expected behavior
The extension appears to be attempting to access or create a config file for itself without creating parent directories as needed.
I'd expect it to create said parent directories.

Actually, I expected vs-commitizen to open or create a commitizen config in the repo itself.

Screenshots
image

Visual Studio (please complete the following information):

  • Community
  • 2019 Preview

Support Dark theme

Hi, thanks for your work, I want to suggest implement a dark theme support. Now your extension looks like this:
default

VS2019 Support

Describe the bug
Add support for Visual Studio 2019

To Reproduce

  1. Install in Visual Studio 2019

Expected behaviour
Completes without error

Add customizable change types

It should be possible to customize the list of change types presented to users when building their commit messages. This customization should work both on at least a local (project/repository config file) basis so that different projects with different commitizen configurations don't require changing Visual Studio settings.

Visual Studio crashes in most cases when opening Team Explorer

Describe the bug
Visual Studio crashes sometimes when opening Team Explorer after just starting up Visual Studio.
My fellow team mates have the same behavior on their machines from time to time. Could it be performance related? When repeating the steps from the reproduction it will not crash after a few retries.

Eventlog shows .NET Runtime error:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at Microsoft.VisualStudio.Shell.ThreadHelper.get_JoinableTaskContext()
at vs_commitizen.vs2015.VsCommitizenNavigationItem+d__4.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
at vs_commitizen.vs2015.VsCommitizenNavigationItem+<GitService_PropertyChanged>d__3.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_1(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

To Reproduce
Steps to reproduce the behavior:

  1. Start Visual Studio
  2. Open Recent project (in this case hosted on Azure DevOps / Git-repo)
  3. Click Connect in the (authentication) dialog that is opening up.

Expected behavior
No crash.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Visual Studio (please complete the following information):

  • Professional or Enterprise (same behavior)
  • 2019 / 16.2.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.