Skip to content

Commit d7aba13

Browse files
committed
Merge branch 'chore/26/switch-to-gengo' of github.com:o2sh/onefetch into chore/26/switch-to-gengo
2 parents c1b95b3 + 96cbc52 commit d7aba13

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

languages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ Racket:
19091909
- white
19101910
- blue
19111911
chip: "#3C5CAA"
1912-
Renpy:
1912+
"Ren'Py":
19131913
ascii: |
19141914
{0} ++++++
19151915
{0} ++++++++++

src/info/langs/language.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl std::fmt::Display for LanguagesInfo {
8484
let percentage = lwp.percentage;
8585
let language_name = language.name();
8686
let circle_color = if self.true_color {
87-
get_circle_color(language_name)
87+
get_chip_color(language_name)
8888
} else {
8989
color_palette[i % color_palette.len()]
9090
};

src/info/langs/language.tera

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub(crate) fn get_colors(s: &str, true_color: bool) -> Vec<DynColors> {
4949
}
5050
}
5151

52-
pub fn get_circle_color(s: &str) -> DynColors {
52+
pub fn get_chip_color(s: &str) -> DynColors {
5353
match s {
5454
{% for language, attrs in languages -%}
5555
{% set rgb = attrs.colors.chip | hex_to_rgb -%}

src/info/langs/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub fn get_main_language(loc_by_language: &[(Language, usize)]) -> Language {
1111
}
1212

1313
/// Returns a vector of tuples containing all the languages detected inside the repository.
14-
/// Each tuple is composed of the language and its corresponding loc (lines of code).
15-
/// The vector is sorted by loc in descending order.
14+
/// Each tuple is composed of the language and its corresponding size.
15+
/// The vector is sorted by size in descending order.
1616
pub fn get_size_by_language_sorted(dir: &Path) -> Result<Vec<(Language, usize)>> {
1717
let builder = gengo::Builder::new(dir);
1818
let gengo = match builder.build() {

tests/snapshots/repo__repo.snap

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ expression: info
4949
"LanguagesInfo": {
5050
"languagesWithPercentage": [
5151
{
52-
"language": "Rust",
52+
"language": {
53+
"name": "Rust",
54+
"category": "programming",
55+
"color": "#DD3515"
56+
},
5357
"percentage": 100.0
5458
}
5559
]
@@ -117,8 +121,8 @@ expression: info
117121
}
118122
},
119123
{
120-
"LocInfo": {
121-
"linesOfCode": 4
124+
"CodeSizeInfo": {
125+
"size": 22
122126
}
123127
},
124128
{

0 commit comments

Comments
 (0)