linguist-generated=true vs. sloc count #6595
-
Hello! We have just added Linguist says
https://github.com/szepeviktor/linguist-on-you/actions/runs/6682473134#summary-18157685264 How can we make linguist ignore generated code and count only 1500 lines?
after removing generated files
Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure why you'd want to do this as Linguist doesn't use LOC when determining the language proportions, it uses bytes of code (the second column in your first output). From How Linguist works:
You can see Linguist is ignoring those files you've marked as generated if you use the ➜ github-linguist --breakdown ./unipoints/
99.97% 61531 PHP
0.03% 20 Batchfile
PHP:
.php-cs-fixer.php
bin/unipoints
build/BlocksBuilder.php
build/BlocksBuilder/Block.php
build/CodepointsBuilder.php
build/CodepointsBuilder/Codepoint.php
build/CodepointsBuilder/Name.php
build/CodepointsBuilder/NameAlias.php
build/CodepointsBuilder/NameAlias/Type.php
build/CodepointsBuilder/UnicodeData.php
build/DataStorage.php
build/FilesystemCache.php
build/UserMessageException.php
src/Category.php
src/Info/BlockInfo.php
src/Info/CategoryInfo.php
src/Info/CodepointInfo.php
src/Info/PlaneInfo.php
src/Info/UnicodeInfo.php
src/Plane.php
test/bootstrap.php
test/service/BlocksBuilderWrapper.php
test/tests/BlocksBuilderTest.php
test/tests/CategoryEnumTest.php
test/tests/DataStorageTest.php
test/tests/FilesystemCacheTest.php
test/tests/PlaneEnumTest.php
Batchfile:
bin/unipoints.bat
➜ If we count all those PHP file we get the 26 files in your last output block: ➜ github-linguist --breakdown ./unipoints/ | grep '.php' | wc -l
26
➜ |
Beta Was this translation helpful? Give feedback.
I'm not sure why you'd want to do this as Linguist doesn't use LOC when determining the language proportions, it uses bytes of code (the second column in your first output).
From How Linguist works:
You can see Linguist is ignoring those files you've marked as generated if you use the
--breakdown
flag: