microsoft / GSL

Guidelines Support Library
Other
6.13k stars 737 forks source link

Add Linguist language override for include files #1079

Closed gerlero closed 1 year ago

gerlero commented 1 year ago

Add a linguist-language Git attribute that matches the files at include/gsl and sets their language to C++. Without this override, these files are not detected as C++ code by GitHub's Linguist (likely due to lacking any file extensions).

This will cause GitHub.com to count these files correctly as C++ code and do syntax highlighting when browsing the repo.

Linguist breakdown results

Before:

``` $ docker run --rm -v $(pwd):$(pwd) -w $(pwd) -t linguist github-linguist --breakdown 91.57% 152148 C++ 8.43% 14011 CMake CMake: CMakeLists.txt cmake/gsl_functions.cmake cmake/gsl_install.cmake include/CMakeLists.txt tests/CMakeLists.txt C++: tests/algorithm_tests.cpp tests/assertion_tests.cpp tests/at_tests.cpp tests/byte_tests.cpp tests/deathTestCommon.h tests/no_exception_ensure_tests.cpp tests/notnull_tests.cpp tests/owner_tests.cpp tests/span_compatibility_tests.cpp tests/span_ext_tests.cpp tests/span_tests.cpp tests/strict_notnull_tests.cpp tests/utils_tests.cpp ```

After:

``` $ docker run --rm -v $(pwd):$(pwd) -w $(pwd) -t linguist github-linguist --breakdown 94.16% 225699 C++ 5.84% 14011 CMake CMake: CMakeLists.txt cmake/gsl_functions.cmake cmake/gsl_install.cmake include/CMakeLists.txt tests/CMakeLists.txt C++: include/gsl/algorithm include/gsl/assert include/gsl/byte include/gsl/gsl include/gsl/gsl_algorithm include/gsl/gsl_assert include/gsl/gsl_byte include/gsl/gsl_narrow include/gsl/gsl_util include/gsl/narrow include/gsl/pointers include/gsl/span include/gsl/span_ext include/gsl/string_span include/gsl/util tests/algorithm_tests.cpp tests/assertion_tests.cpp tests/at_tests.cpp tests/byte_tests.cpp tests/deathTestCommon.h tests/no_exception_ensure_tests.cpp tests/notnull_tests.cpp tests/owner_tests.cpp tests/span_compatibility_tests.cpp tests/span_ext_tests.cpp tests/span_tests.cpp tests/strict_notnull_tests.cpp tests/utils_tests.cpp ```
dmitrykobets-msft commented 1 year ago

Great, thanks!