Count the .6502 sources as assembly in GitHub's Languages bar

Aperta Adatta ai principianti
#16 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
95/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, github
Ambito
tooling

Direzione di ricerca

Aggiungi le regole Linguist mostrate a un .gitattributes di primo livello, associando *.6502 a Assembly e *.ctl a Text. L'issue fornisce le voci esatte; la regola facoltativa per i file generati è esplicitamente una scelta separata. Controlla la barra Languages di GitHub per verificare che i sorgenti 6502 vengano conteggiati come Assembly e che i file di controllo non vengano più conteggiati come Visual Basic 6.0.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

GitHub's Languages bar shows this repo as Python, Visual Basic 6.0 and JavaScript, with a sliver of Assembly. gh api repos/mattgodbolt/nm/languages gives, in bytes:

Python 159,502 · Visual Basic 6.0 61,227 · JavaScript 52,552 · Shell 6,922 · Makefile 5,641 · Assembly 2,600

That Assembly is only tools/music/player.asm. The 34 .6502 files (208 KB of baron source) aren't counted at all: Linguist has no 6502 language and doesn't know the extension, so it skips them. The Visual Basic 6.0 is the three SkoolKit control files in disasm/, which Linguist takes for VB6 by their .ctl extension.

A .gitattributes at the top fixes both:

# For GitHub's Languages bar (Linguist).

# The port's baron sources. Linguist has no 6502 language and doesn't know
# the .6502 extension, so without this they aren't counted at all.
*.6502 linguist-language=Assembly

# SkoolKit control files, which Linguist takes for Visual Basic 6.0 by their
# extension. Text keeps them out of the bar and shows them as plain text.
*.ctl linguist-language=Text

Linguist counts Assembly because it's a programming language, so linguist-detectable isn't needed. Text is prose, so it isn't counted.

starglider-beeb now does the same (https://github.com/mattgodbolt/starglider-beeb/commit/73a90da77452a7414793ce6641e26bd186b30b23). Its bar went from Python, JavaScript and Visual Basic 6.0 to Python then Assembly.

Optional: src/data/levels.6502, music.6502 and vars.6502 (16 KB) are written by tools/mklevels.py, mkmusic.py and mkvars.py. Adding src/data/*.6502 linguist-generated would leave them out of the bar too, but it also collapses their diffs on GitHub by default, so it's a choice rather than part of the fix.

Lingua principale
Python
Stelle
2
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mattgodbolt/nm

Tutte le issue di mattgodbolt/nm

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.