o2sh / o2sh/onefetch

Automatically detect if no programming language is present to show overview in data-only repository

Open
#1,311 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
12k
Forks
332
Avg merge
1d 23h
Merged PRs (30d)
17

Description

Hi!

Summary 💡

Even in repositories where there are no programming languages (e.g. https://github.com/LemmyNet/lemmy-ansible) but only data/configuration, by default you get this:

Error: Could not find any source code in this repository

Maybe in such cases it shouldn't ignore non-programming languages and produce an error output, but fall back to the other most prevalent language.

Motivation 🔦

Related to https://github.com/o2sh/onefetch/issues/1208.
I didn't know right away how to make YAML appear and I was confused because I saw that it was supported as a language, then I found that issue and understood, but it wasn't very intuitive.

Maybe it is also worth reopening that issue, I think an improvement there could be to enrich this error message with suggestions, like:

Error: Looking for programming language source code, but couldn't find any in this repository
       You can add the option `-T data/markup/...` to show the repository overview regardless

Or even better, based on the content of the repository, it could suggest which argument to provide to the -T option, though, if it's able to do that, it would probably be better to just do it without further user intervention, which falls back into this issue (idk, I'm confused because I'm not aware of all the possibilities)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. First locate the language-detection path and the -T option handling in this CLI, then reproduce the error with a data-only repository such as LemmyNet/lemmy-ansible. Before implementation, clarify whether completion means automatic fallback, an improved suggestion, or both, and verify that the chosen behavior shows the repository overview.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.