locked
Team Coding Standards RRS feed

  • Question

  • Hello.

    Is there a possibility to enforce somehow a coding standards for the development team for the specific team project?

    We are using TFS 2018 RC2 and VS 2017.

    Thanks for responses.

    Kind regards,

    Zdeněk Neustupa


    Zdeněk Neustupa

    Sunday, November 12, 2017 9:28 AM

Answers

  • Not to a TFS source control repository directly, but you can configure each solution to adhere to certain rules using StyleCop (MsBuild or Roslyn) if you combine this with EditorConfig, Visual Studio will also automatically apply the right formatting.

    To enforce this, you can setup a CI build in TFS/VSTS to automatically trigger when code is checked in, this will detect formatting faults and can optionally block the check-in completely.


    My blog: blog.jessehouwing.nl

    Monday, November 13, 2017 10:51 AM

All replies

  • Hi Zdeněk,

    Is your requirement related to TFS?

    Could you elaborate your requirement?

    Best regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, November 13, 2017 7:18 AM
  • Not to a TFS source control repository directly, but you can configure each solution to adhere to certain rules using StyleCop (MsBuild or Roslyn) if you combine this with EditorConfig, Visual Studio will also automatically apply the right formatting.

    To enforce this, you can setup a CI build in TFS/VSTS to automatically trigger when code is checked in, this will detect formatting faults and can optionally block the check-in completely.


    My blog: blog.jessehouwing.nl

    Monday, November 13, 2017 10:51 AM
  • Hello.

    Well to be honest, I am not sure. I saw i video online from a Microsoft conference where they were advertising how you can simply make a coding standard template in the solution. It was XML looking like file in which you can describe for example that the preferred way of naming methods is first letter upper case and many more. Since then I couldn't find the video anymore. I don't know if it was dependant on TFS or solely on Visual Studio. If I posted the thread in the wrong section, I am sorry.

    Thank you for any response.

    Zdeněk Neustupa


    Zdeněk Neustupa

    Tuesday, November 21, 2017 9:45 AM
  • Hello Jesse.

    That looks promising. It is no necessary to block check-in. But I was hoping to enforce the coding standards on the developers in their Visual Studio. It seems that the .editorconfig file could be part of the solution hopefully, part of the repository and therefore synchronize for all the developers on the team. I will test it, hope it is what I need. Thank you again for your response.


    Zdeněk Neustupa

    Tuesday, November 21, 2017 10:07 AM