Skip to content

docs: replace broken loc count with static count#6615

Open
Nitrrine wants to merge 1 commit into
modrinth:mainfrom
Nitrrine:patch-1
Open

docs: replace broken loc count with static count#6615
Nitrrine wants to merge 1 commit into
modrinth:mainfrom
Nitrrine:patch-1

Conversation

@Nitrrine

@Nitrrine Nitrrine commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

README used https://ghloc.vercel.app/ before for counting lines of code which worked before repo grew big, now their API returns Too large repository, i have not been able to find any alternatives that will support big monorepos and provide us with simple API, people suggest to use github actions to update readme for dynamic LoC display which in my opinion is not a great idea.

This PR replaces broken dynamic LoC count with static text, lines of code have been counted using tokei.

Signed-off-by: Nitrrine <43351072+Nitrrine@users.noreply.github.com>
@modrinth-bot

Copy link
Copy Markdown
Member

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@Prospector

Copy link
Copy Markdown
Member

if it didn't take a significant amount of time, it could be counted with the pnpm prepr commands which get run quite often, but might not be worth the hassle and i wouldn't want these commands to be slower than they already are. maybe could happen in parallel though

@Nitrrine

Nitrrine commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

I just feel it's gonna be weird updating README constantly just for precise amount of LoC in the repo lol

@creeperkatze

creeperkatze commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Randomly stumbled upon this problem, there are really no alternatives for large repos.

Decided to take this as a challenge to see how a minimal rust backend for counting loc would work, turned into https://github.com/creeperkatze/loctopus.

Its one of those simple apps that I keep running as a docker container basically forever anyway, since its very unlikely it will get popular enough where compute becomes an issue.

Feel free to use it if you want.

The api is very simple, its just:

https://loctopus.creeperkatze.dev/github/modrinth/code

And for shields.io:

https://loctopus.creeperkatze.dev/github/modrinth/code/badge

Examples:

Lines

It contains Lines lines.

@Prospector

Copy link
Copy Markdown
Member

would be cool if it formatted the number to be more readable

@creeperkatze

Copy link
Copy Markdown
Contributor

This is already implemented, just by adding format=human as a url param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants