2mol / 2mol/pboy

(failure to?) sanitise fully capitalised suggestions

Offen Anfängerfreundlich
#53 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Haskell
Sterne
744
Forks
22
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I often see a suggested filename where the text is ALL CAPS. When this occurs, would it be better to convert to Title Case?

The line [& titlecase](https://github.com/2mol/pboy/blob/a5ae553525d873b45e4bd829b8358705313d2b1e/src/Lib.hs#L145) seems to already be trying to do this, so is the behaviour a bug? Sorry if I have misunderstood the code, I don't read Haskell well.

Actually looking into Data.Text.Titlecase function, I don't think it would change an ALL CAPS string, so a fix may be to `Data.Text.toLower` the text before `titlecase`.

I would be happy to provide test cases where this happens, if you like.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The issue points to src/Lib.hs line 145 where titlecase is applied. Look at the Data.Text.Titlecase function to understand its behavior with all-caps input. The suggested fix is to call Data.Text.toLower before titlecase. Write a test to verify the change works on all-caps filenames. Run the existing test suite to ensure no regressions.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
haskell
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
70/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.