Adding a pixi lock-file makes a repository look like it's mostly YAML #2462

Open
opened 2026-03-18 19:03:35 +01:00 by stephane-caron · 3 comments

Comment

After switching a repository to pixi and adding the pixi.lock file in this commit, I noticed that the project now appears as 82.7% YAML:

image

This does not reflect the project of course, it's just that the pixi lock file is 2000+ lines of YAML. This would also happen with other env/package management tools like uv in Python or cargo in Rust.

I would like to open the discussion here, with the suggestion that these lock files are skipped in a repository's language-percentage count.

PS: I haven't contributed to Forgejo so far, but if this is a good first issue (not so intricate) I'd be happy to take a stab at proposing a PR.

### Comment After switching a repository to pixi and adding the `pixi.lock` file in [this commit](https://codeberg.org/stephane-caron/lpsolvers/commit/d73516df3674e91e798205d231d2f51e890d9d21), I noticed that the project now appears as 82.7% YAML: ![image](/attachments/64421adf-412d-4989-b465-c2e310bc4b66) This does not reflect the project of course, it's just that the pixi lock file is 2000+ lines of YAML. This would also happen with other env/package management tools like `uv` in Python or `cargo` in Rust. I would like to open the discussion here, with the suggestion that these lock files are skipped in a repository's language-percentage count. PS: I haven't contributed to Forgejo so far, but if this is a good first issue (not so intricate) I'd be happy to take a stab at proposing a PR.
Member

Have a look here, please: https://forgejo.org/docs/latest/user/language-detection/

Likely, following line in a .gitattributes file, may solve your issue?:

pixi.lock linguist-generated
Have a look here, please: https://forgejo.org/docs/latest/user/language-detection/ Likely, following line in a `.gitattributes` file, may solve your issue?: ``` pixi.lock linguist-generated ```
Author

Thank you for your feedback. Well, there was already a linguist-generated tag for pixi.lock in the project's .gitattributes file:

pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff

I tried updating the file to

pixi.lock merge=binary linguist-generated -diff

And that way worked: the project got evaluated as 100% Python again. 🟩

I then tried:

  • Add back =true to linguist-generated: still 100% Python 🟩
  • Add back linguist-language=YAML before linguist-generated: back to 87% YAML 🟥

Therefore it looks like this could be a parsing issue when a linguist-language comes before linguist-generated?

Thank you for your feedback. Well, there was already a linguist-generated tag for `pixi.lock` in the project's [`.gitattributes` file](https://codeberg.org/stephane-caron/lpsolvers/raw/commit/601221df910fe67dffafe01fab83134914f0aa2e/.gitattributes): ``` pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff ``` I tried updating the file to ``` pixi.lock merge=binary linguist-generated -diff ``` And that way worked: the project got evaluated as 100% Python again. 🟩 I then tried: - Add back `=true` to `linguist-generated`: still 100% Python 🟩 - Add back `linguist-language=YAML` before `linguist-generated`: back to 87% YAML 🟥 Therefore it looks like this could be a parsing issue when a `linguist-language` comes before `linguist-generated`?
Member

I just confirmed that also if you put linguist-language=YAML after linguist-generated it still is back to 87% YAML 🟥.

Thus, the issue is that the language detection does not care at all about the linguist-generated flag.

I just [confirmed](https://v15.next.forgejo.org/mahlzahn/lpsolvers) that also if you put `linguist-language=YAML` after `linguist-generated` it still is back to 87% YAML 🟥. Thus, the issue is that the language detection does not care at all about the `linguist-generated` flag.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#2462
No description provided.