-
-
Couldn't load subscription status.
- Fork 1.1k
Description
cloc already looks at the shebangs for files. But it would be very useful if there could be other methods for defining types that have the same file extensions. I'm thinking specifically of json files, which contain so many different types information. In my scenario I have Microsoft Azure Logic App code and Microsoft Azure Resource Management (ARM) templates both with json-extensions. But these are very different types and I would like to count them separately.
Would it be possible to add an optional regex to a type definition for 'type identification'. So I can define a type Logic App with extension json where the files should contain .*https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json.* for example.
Ordering is then important, if a file is matched it will count towards that defined type. All more specific types, i.e. with 'type identification' regex should be before any types with the same extension but without the 'type identification'.
This may also solve #837.