Skip to content

Commit

Permalink
Merge branch 'chore/26/switch-to-gengo' of github.com:o2sh/onefetch i…
Browse files Browse the repository at this point in the history
…nto chore/26/switch-to-gengo
  • Loading branch information
spenserblack committed Sep 5, 2023
2 parents c1b95b3 + 96cbc52 commit d7aba13
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ Racket:
- white
- blue
chip: "#3C5CAA"
Renpy:
"Ren'Py":
ascii: |
{0} ++++++
{0} ++++++++++
Expand Down
2 changes: 1 addition & 1 deletion src/info/langs/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl std::fmt::Display for LanguagesInfo {
let percentage = lwp.percentage;
let language_name = language.name();
let circle_color = if self.true_color {
get_circle_color(language_name)
get_chip_color(language_name)
} else {
color_palette[i % color_palette.len()]
};
Expand Down
2 changes: 1 addition & 1 deletion src/info/langs/language.tera
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub(crate) fn get_colors(s: &str, true_color: bool) -> Vec<DynColors> {
}
}

pub fn get_circle_color(s: &str) -> DynColors {
pub fn get_chip_color(s: &str) -> DynColors {
match s {
{% for language, attrs in languages -%}
{% set rgb = attrs.colors.chip | hex_to_rgb -%}
Expand Down
4 changes: 2 additions & 2 deletions src/info/langs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ pub fn get_main_language(loc_by_language: &[(Language, usize)]) -> Language {
}

/// Returns a vector of tuples containing all the languages detected inside the repository.
/// Each tuple is composed of the language and its corresponding loc (lines of code).
/// The vector is sorted by loc in descending order.
/// Each tuple is composed of the language and its corresponding size.
/// The vector is sorted by size in descending order.
pub fn get_size_by_language_sorted(dir: &Path) -> Result<Vec<(Language, usize)>> {
let builder = gengo::Builder::new(dir);
let gengo = match builder.build() {
Expand Down
10 changes: 7 additions & 3 deletions tests/snapshots/repo__repo.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ expression: info
"LanguagesInfo": {
"languagesWithPercentage": [
{
"language": "Rust",
"language": {
"name": "Rust",
"category": "programming",
"color": "#DD3515"
},
"percentage": 100.0
}
]
Expand Down Expand Up @@ -117,8 +121,8 @@ expression: info
}
},
{
"LocInfo": {
"linesOfCode": 4
"CodeSizeInfo": {
"size": 22
}
},
{
Expand Down

0 comments on commit d7aba13

Please sign in to comment.