0

I just noticed the strange behavior from cloc as per below

$ll
total 112
-rw-r--r--  1 chaoshi  staff   6271 Jul  4 15:14 admin.blade.php
-rw-r--r--  1 chaoshi  staff   6821 Jul  4 15:14 email.blade.php
-rw-r--r--  1 chaoshi  staff  14762 Jul  4 15:14 environment.blade.php
-rw-r--r--  1 chaoshi  staff   1213 Jul  4 15:14 finish.blade.php
-rw-r--r--  1 chaoshi  staff   8575 Jul  4 15:14 migration.blade.php
-rwxr-xr-x  1 chaoshi  staff   3602 Jul  4 15:14 requirements.blade.php
-rwxr-xr-x  1 chaoshi  staff   1466 Jul  4 15:14 welcome.blade.php

$cloc .
       7 text files.
       7 unique files.
       0 files ignored.

github.com/AlDanial/cloc v 1.96  T=0.02 s (378.4 files/s, 48004.7 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Blade                            7            111              0            777
-------------------------------------------------------------------------------
SUM:                             7            111              0            777
-------------------------------------------------------------------------------

so it looks like files with .blade.php extension are counted as blade files instead of php files; is there anyway I could force those to be identified as php files?

thanks!

DarkBee
  • 16,592
  • 6
  • 46
  • 58
sqr
  • 365
  • 2
  • 12
  • 29
  • According to the [Recognized Languages](https://github.com/AlDanial/cloc#recognized-languages-) blade.php is considered as Blade Language not PHP, I think that you need to contact the maintainer himself to consider Blade files as PHP instead of Blade or at least to add some options to cloc to allow change the language definitions – hassan Jul 04 '23 at 09:33

1 Answers1

1

Use

cloc --force-lang=PHP,blade.php  .

to count *.blade.php files as PHP

AlDanial
  • 419
  • 2
  • 4