Skip to content

Support repos "without source code" #1580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 10, 2025
Merged

Support repos "without source code" #1580

merged 11 commits into from
Jun 10, 2025

Conversation

o2sh
Copy link
Owner

@o2sh o2sh commented Jun 7, 2025

fix for #1578 (opened by @Kajiih)

With this PR, we can now display project information even if no source code is detected.

I have added a PrinterFactory that handles the logic of creating the appropriate printer depending on the context:

  • JsonPrinter and YamlPrinter printers if --output is used
  • PlainPrinter (no ASCII art, just info lines) when the --no-art option is used, or when no source code is detected and no --ascii-input is provided
  • ImagePrinter if --image is provided and the terminal supports it
  • AsciiPrinter as the default case, displaying the dominant language (or override), or if --ascii-input is provided

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@o2sh o2sh added the fix label Jun 7, 2025
fix
fix
@o2sh o2sh marked this pull request as ready for review June 7, 2025 22:46
fix
Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just some nitpicks and thoughts.

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (again)!

fix
@o2sh o2sh merged commit c38a6b5 into main Jun 10, 2025
4 checks passed
@o2sh o2sh deleted the fix/no-code-repo branch June 10, 2025 17:35
@o2sh o2sh added feat and removed fix labels Jul 5, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 6, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [o2sh/onefetch](https://github.com/o2sh/onefetch) | minor | `2.24.0` -> `2.25.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>o2sh/onefetch (o2sh/onefetch)</summary>

### [`v2.25.0`](https://github.com/o2sh/onefetch/releases/tag/2.25.0)

[Compare Source](o2sh/onefetch@2.24.0...2.25.0)

<!-- Release notes generated using configuration in .github/release.yml at main -->

#### What's Changed

##### New Features

- add language support for Lean by [@&#8203;Kajiih](https://github.com/Kajiih) in o2sh/onefetch#1579
- support repos "without source code" by [@&#8203;o2sh](https://github.com/o2sh) in o2sh/onefetch#1580

##### Chores

- improve error handling by [@&#8203;Mahdiglm](https://github.com/Mahdiglm) in o2sh/onefetch#1560

##### Bug Fixes

- remove extra line break by [@&#8203;o2sh](https://github.com/o2sh) in [`886d942`](o2sh/onefetch@886d942)

#### New Contributors

- [@&#8203;Mahdiglm](https://github.com/Mahdiglm) made their first contribution in o2sh/onefetch#1560
- [@&#8203;Kajiih](https://github.com/Kajiih) made their first contribution in o2sh/onefetch#1579

**Full Changelog**: o2sh/onefetch@2.24.0...2.25.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants