forked from github-linguist/linguist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filesize metrics to
github-linguist
output (github-linguist#5464)
* Adding detailed-stats option to git-linguist results When generating Linguist statistics via the command-line currently the only information returned is a hash of the language and it's percentage of the repository it takes up. Sometimes it's important to also know the file size of each language. This adds a new option to the command=line interface called `detailed-stats` which returns back a JSON representation of the repository broken down by language and returning _both_ the percentage of the repository that language comprises and the total file size in bytes for that language. This will allow consumers an expanded ability to extend and use the information available for their tooling. * Removing change to git-linguist based on feedback * Moving the functionality into a method for processing * Moving functionality to use OptionsParser Previously, you could only choose to have a summary of the Linguist file sizes, a breakdown including the summary and a list of files per language, _or_ JSON output of the files per language. This has the limitation where you cannot get all of the information in both formats. By moving to using OptionsParser, we're able to more easily separate the data the user is looking to get (summary or breakdown) and the format they want the data to be returned in (CLI-friendly output or JSON). * For full repository, separating data and format concerns Implementing the separation of which data we want to collect from which format we want to get the data in when processing a full repository. * Adding the size of files for each language to the output * Renaming variable for JSON to make it more clear as to intent * Updating readme to match command line functionality * Update bin/github-linguist Fixing indentation as suggested in review Co-authored-by: Colin Seymour <[email protected]> * Update bin/github-linguist Reusing HELP_TEXT when aborting due to an issue Co-authored-by: Colin Seymour <[email protected]> * Updating help text for new OptionsParser options * README Updates based on recommendation Co-authored-by: Colin Seymour <[email protected]>
- Loading branch information
Showing
2 changed files
with
165 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters