AlDanial / cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
GNU General Public License v2.0
19.75k stars 1.02k forks source link

Ignore files auto-generated by specflow #753

Closed guenhter closed 1 year ago

guenhter commented 1 year ago

For other enhancements:

When C# SpecFlow generate files, they usually start with

// ------------------------------------------------------------------------------
//  <auto-generated>
//      This code was generated by SpecFlow (http://www.specflow.org/).
//      SpecFlow Version:2.1.0.0
//      SpecFlow Generator Version:2.0.0.0
//
//      Changes to this file may cause incorrect behavior and will be lost if
//      the code is regenerated.
//  </auto-generated>
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
namespace COM_EuLynx.FeatureFiles

When the option --no-autogen is specified, those files also should be ignored.

AlDanial commented 1 year ago

Can you provide a C# SpecFlow file to be added to the unit tests?

guenhter commented 1 year ago

Here a "complete" specflow file (without actual function inside but the important stuff is contained):

File Application_Data_Test.feature.cs

// ------------------------------------------------------------------------------
//  <auto-generated>
//      This code was generated by SpecFlow (https://www.specflow.org/).
//      SpecFlow Version:3.9.0.0
//      SpecFlow Generator Version:3.9.0.0
// 
//      Changes to this file may cause incorrect behavior and will be lost if
//      the code is regenerated.
//  </auto-generated>
// ------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable
namespace Foo_Bar.FeatureFiles
{
    using TechTalk.SpecFlow;
    using System;
    using System.Linq;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.9.0.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [NUnit.Framework.TestFixtureAttribute()]
    [NUnit.Framework.DescriptionAttribute("Application Data_Test")]
    public partial class ApplicationData_Test
    {
        // ...
    }
}
#pragma warning restore
#endregion