cloc icon indicating copy to clipboard operation
cloc copied to clipboard

.net projects and .config files

Open StephaneG31 opened this issue 6 years ago • 3 comments

.net projects (in windows) use .config files which are in XML Format. It will be great if cloc can count this kind of files

StephaneG31 avatar Feb 28 '19 10:02 StephaneG31

The unfortunate thing is that .config is so generic and could contain anything and used by many different programs. I wonder why Microsoft couldn't just stick a .xml extension at the end?

In any case you can force cloc to treat .config files as XML files two different ways. First with

cloc --force-lang=XML,config   your_dotnet_proj/

and second, with a custom language filter, ref https://github.com/AlDanial/cloc#create-custom-language-definitions-

AlDanial avatar Mar 07 '19 05:03 AlDanial

The dotnet project files have .csproj and .fsproj extensions for C# and F#. There is also VB but I don't remember the extension.

iSeiryu avatar Mar 15 '23 14:03 iSeiryu

.csproj and .fsproj are already recognized:

» cloc --show-ext csproj
csproj          -> MSBuild script

» cloc --show-ext fsproj
fsproj          -> XML

Difficult to say which association is most applicable: dotnet, XML, C#, F#, MS Build

AlDanial avatar Mar 16 '23 03:03 AlDanial