2025-04-26
- Fixed files with long first lines causing the script to hang (#41).
2025-04-04
- Added CLI error message when passing invalid category input.
- Fixed npm version warning (#42).
2025-02-09
- Added
minSizeCLI option to control a minimum size for results, with languages smaller than this threshold moved into 'Other' (#32, #35).
2024-12-05
- Fixed gitignore paths being applied as root-relative (#36).
- Fixed bad indentation of a mapping entry from reading heuristic (#37).
2024-09-15
- Added checking of gitattributes override rule
linguist-detectable. - Added lines of code totals to the output.
- Added option
checkDetectedto control the application oflinguist-detectableoverrides. - Added option
calculateLines(defaults to true) to control whether LOC calculations are performed.
2024-05-08
- Fixed gitignore file reading not pertaining exactly to spec.
- Improved performance by filtering out gitignored files during folder traversal.
2024-03-09
- Fixed gitattributes comments being parsed as attributes data.
- Fixed gitignores data being parsed root-relative instead of relative to the folder the file is in.
2024-03-02
- Added CLI option
--listFilesto list each matching file under each language result. - Fixed files that are by default marked vendored being removed even when marked as not vendored in gitattributes (#26).
- Fixed a crash occurring when applying some language parents (#27).
- Fixed gitattributes rules from parent folders being erroneously applied.
2023-07-24
- Fixed file paths not resolving properly when analysing multiple folders (#25).
2023-06-29
- Add
alternativeskey to list all possible alternative language classifications for files that do not have a definite match (#15, #19).
2023-06-28
- Changed fetching of data files to fallback to using the packaged files if the fetch request fails (#21).
- Fixed packaged data files having formatting issues.
2023-06-25
- Fixed a crash occurring when parsing heuristics with negative inline PCRE flags.
- Changed cached data files to be compressed when packaged.
2023-01-11
- Fixed gitattributes wildcards not being applied into subfolders (#17).
2022-09-03
- Fixed a crash occurring when parsing heuristics for
.txtfiles (#16).
2022-06-28
- Fixed file extensions with multiple delimiters not being prioritised over basic extensions.
- Fixed modeline checking not trimming comments from the first line.
- Fixed modeline checking being applied to the first line even when it does not contain a modeline.
- Fixed fallback language detection not being applied when an ambiguous interpreter is declared in a shebang line.
2022-06-26
- Fixed heuristics not being applied to files.
- Fixed heuristics with multiple rules not being parsed.
2022-05-14
- Added boolean option
offlineto allow the use of pre-packaged metadata files instead of having them fetched from GitHub at runtime. - Added
linguist-jsas an alias of thelinguistexecutable.
2022-03-20
- Fixed a crash occurring because of outdated file caches.
- Fixed heuristics not being applied when using raw file input.
2022-02-24
- Fixed parsing of gitignore statements not matching its specification.
- Fixed generated file names being applied case-sensitively.
- Fixed generated files not being excluded from the input when using raw file mode.
- Fixed modeline language selection not working for languages containing non-alphanumeric characters.
2022-02-19
- Added boolean option
checkModeline(defaults totrue) to check the modeline of files for explicit classification. - Fixed shebang statements not taking priority over other methods of disambiguation.
2022-02-18
- Changed vendored checking to include paths marked as documentation.
- Fixed array input not being parsed properly when used with
fileContent. - Fixed vendor patterns being erroneously applied to parent folders.
- Fixed vendor patterns made for relative paths not being applied.
2022-02-16
- Fixed a crash occurring when parsing heuristics containing atomic groups.
- Fixed option
fileContentbeing ignored if set to an empty string. - Fixed file extensions being treated as case sensitive.
2022-02-13
- Added option
fileContentto provide manual file content to analyse instead of reading from a folder on disk.
2022-02-11
- Fixed files marked as
text=autobeing classified as text. - Fixed a crash occurring when attempting to load unreadable files.
2022-01-06
- Added option
relativePathsto allow output results to be shown as relative paths (defaults tofalse). - Changed CLI output to display the number of skipped files.
- Fixed git config entries containing backslashes causing a crash.
2021-09-29
- Fixed gitignore entries containing dots not being parsed properly.
- Fixed git config files containing character classes like
[[:digit:]]not being parsed properly.
2021-09-19
- Changed gitattributes parsing to support
textandbinaryparameters. - Fixed a crash occurring when compiling regular expressions.
2021-09-14
- Fixed languages without a colour not having their icon displayed properly in the CLI output.
- Fixed unknown extensions erroneously having an extra dot prefix in the CLI output.
2021-09-12
- Changed CLI output to display associated language colours.
- Fixed filenames not taking precedence over extensions when classifying.
- Fixed parent languages not being checked when parsing heuristics relating to their children.
2021-09-11
- Added nullable
parentproperty to each entry inlanguages.resultsto display the parent language. - Added option
childLanguagesto control whether child languages are displayed instead of their parent (defaults tofalse).
2021-09-11
- Changed the error thrown when traversing an invalid tree via CLI to contain a more useful description.
- Fixed heuristics not applying start- and end-of-line markers properly (#5).
- Fixed heuristic language fallback not being applied properly.
2021-09-09
- Fixed CLI usage not working when installed with Yarn (#2).
- Fixed a crash that occurred when file contents changed between runs (#4).
- Fixed heuristics containing dot wildcards being incorrectly applied (#5).
- Fixed vendored/generated files containing dots not being classified as vendored.
2021-09-08
- Changed file paths in CLI output JSON to be absolute instead of relative (#3).
- Fixed percentages in CLI output displaying
NaNwhen the total byte count is0.
2021-09-05
- Breaking: Changed output schema:
count→files.countresults→files.resultslanguages.all→languages.resultslanguages.data→ (deleted)languages.markup→ (deleted)languages.programming→ (deleted)languages.prose→ (deleted)languages.unknown→unknown.{filenames|extensions}languages.total.unique→languages.countlanguages.total.bytes→languages.byteslanguages.total.unknownBytes→unknown.bytes
- Breaking: Changed the default CLI output format from JSON to summary.
- Breaking: Changed CLI array arguments to require delimiters to be spaces instead of other characters.
- Breaking: Changed the name of option
ignoreFilestoignoredFiles. - Breaking: Changed the name of option
ignoreLanguagestoignoredLanguages. - Added CLI option
--jsonto display the results as JSON (the previous default behavior). - Removed CLI option
--summaryas it is now the default output format. - Removed CLI option
--filesto list all files parsed. - Removed deprecated option
ignorewhich was superceded byignoredFiles.
2021-08-29
- Fixed a crash occurring when using both the
categoriesandignoreLanguagesoptions together.
2021-08-29
- Added
ignoreLanguagesoption to configure which languages to ignore. - Added alias
ignoreFilesfor optionignore. - Added CLI argument
--treeto traverse the output tree to a specific object instead of logging the entire results. - Deprecated option
ignoreas it is now ambiguous.
2021-08-28
- Fixed known vendored files not being removed from output.
2021-08-28
- Fixed input folder paths being case sensitive.
- Fixed dotfiles not showing up in the output.
2021-08-24
- Added support for the first argument to
analyse()to be an array of paths.
2021-08-21
- Changed file paths specified in option
ignoreto remain hidden even whenkeepVendoredis enabled. - Fixed file results not being listed when using globbed input.
- Fixed command-line arguments not being fully normalised.
2021-08-19
- Added
categoriesoption to control which language categories (data,markup,programming, and/orprose) should be included in the output. - Fixed some files being incorrectly classified as binary.
2021-08-17
- Changed binary file checking to check file content as well as extension.
- Fixed filename matching not comparing the full base name to the list of filename matches.
2021-08-15
- Added checking of binary files to avoid including them in the language results.
- Added
keepBinaryoption to control whether binary files are checked (defaults tofalse).
2021-08-15
- Fixed a crash occurring when using the CLI.
2021-08-15
- Fixed CLI options not being able to be negated.
- Fixed CLI option
--ignorenot allowing delimited paths.
2021-08-14
- Fixed shebang interpreter checking more than just the first line.
2021-08-14
- Changed web requests to be cached upon fetch, improving performance of successive runs.
2021-08-14
- Fixed PCRE regular expressions causing a crash.
- Fixed shebang lines not being fully checked.
- Fixed heuristics with two fallback languages not choosing just one of them.
- Fixed extensions being checked alongside filenames instead of being checked after, as the latter should take priority.
2021-08-12
- Added checking of shebang (
#!) lines for explicit language classification. - Added
checkShebangoption to implement shebang checking (defaults totrueunlessquickis set).
2021-08-10
- Fixed files prefixed with a dot not being checked.
- Changed input of command-line
--ignoreto be delimited by spaces.
2021-08-03
- Added an nullable
colorkey to each entry inlanguages.all.
2021-08-01
- Changed outputted file paths to always be absolute regardless of input.
2021-08-01
- Fixed crash occurring when checking named patterns.
2021-08-01
- Added
allkey tolanguageswhich collates all language data into one object.
2021-08-01
- Added heuristics checking, using option
checkHeuristics(defaults totrueunlessquickis set). - Added
--summaryCLI option to output language data in human-readable manner instead of JSON. - Added
unknownByteskey tolanguages.totalwhich lists the bytes size of unknown languages. - Changed vendored file checking to classify generated files as well.
2021-07-31
- Added
unknownkey tolanguageswhich lists file extensions that cannot be matched with a given language. - Change ignored files list to be globs instead of raw regexes.
- Fixed CLI usage defaulting to quick checking instead of full checking.
2021-07-31
- Changed the delimiter for ignored paths in the CLI
--ignoredargument from;to:/;/|as a semicolon is actually valid on Windows.
2021-07-31
- Added checking of
.gitignorefiles. - Added option
ignorefor specifying explicitly-ignored file paths. - Added specific options
checkIgnoredandcheckAttributes, which can be set together using the inverse ofquick. - Fixed unique language count being incorrect.
2021-07-25
- Fixed file name matching not working.
- Fixed file extensions being case sensitive.
2021-07-22
- Added type definitions due to TypeScript rewrite.
2021-07-21
- Added CLI argument
--quick/-qfor skipping the checking of gitattributes files. - Changed the checking of gitattributes files to be default behaviour.
- Removed CLI argument
--gitattributes/-gas it is now the default behaviour.
2021-07-21
- Added CLI argument alias
-Vfor--vendored. - Changed files with no language to output a language of
nullinstead of being removed from the list. - Fixed gitattributes statements not being checked.
2021-06-24
- Added alias
--filesfor--full. - Added CLI command
--version. - Fixed the analyser crashing when it comes across a heuristic that cannot be matched to a language.
2021-06-06
- Added gitattributes checking using option
checkAttributes(Node) or--gitattributes(CLI). - Added unique language count and total bytes size to output as
languages.total.
2021-06-05
- Changed file classification to use the default heuristic value if applicable.
2021-06-05
- Changed file analysis to filter out vendored files first before analysing languages, increasing performance.
2021-06-05
- Added options argument to analyser function.
- Added
keepVendoredoption to control whether vendored files are kept or not. - Added CLI option
--fullto log a full list of parsed files. - Added CLI option
--vendoredto include vendored files in output. - Fixed input folder not being parsed.
2021-06-05
- Fixed command-line usage not working.
2021-06-05
- Added function to analyse the languages used in a repository.
- Added CLI command
linguist.