Teach ad-hoc hooks line-parsing using regexes in YAML
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 15/100
Rechercherichtung
The proposal centres on extract_messages and the MESSAGE_REGEX and MESSAGE_TYPE_CATEGORIZER constants that built-in hooks use to parse tool output, and asks whether ad-hoc hooks could declare the same behaviour in the YAML config. Read how built-in hooks use those constants and how ad-hoc hooks are loaded from the config, then settle the design questions in the thread. The issue is open-ended, so 'done' needs a maintainer decision on the config schema and testing approach first.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Many non-ad-hoc (pre-commit) hooks seem just to get the error code and parse stdout using extract_messages with the right MESSAGE_REGEX and MESSAGE_TYPE_CATEGORIZER.
Ad-hoc hooks could be taught how to do that from the overcommit YAML config file using:
- one regex for the message (a good default being the Emacs format)
- one optional regex to test whether the message is a warning or an error ("warning:" seems pretty common)
- maybe one optional regex to prefilter lines (empty lines, non-standard line, etc.), and flags to capture stdout and/or stderr, if we really need or want to handle more cases
Of course I guess in the end it all boils down to whether one prefers Ruby to regexes! 😉
Anyway this might still be a good alternative for non-Ruby programmers to easily contribute hooks, and a good way to write less code (although I am not sure yet how tests could be written).
Thoughts?
- Vorherrschende Sprache
- Ruby
- Sterne
- 4k
- Forks
- 288
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 18
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus sds/overcommit
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
sds/overcommit#909 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
sds/overcommit#847 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 62/100
sds/overcommit#908 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
sds/overcommit#875 ·
Maintainer antworten meist innerhalb von 1 Tag
-
help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
sds/overcommit#869 ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
seek4science/seek#2784 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
yosiat/panko_serializer#243 ·
-
enhancement priority: medium risk: low v1.9.0
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
davidteren/mutineer#379 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Translation tutorial: snippet crashes on chunks export and misses simple { t } entriesEvtl. vergeben @Mahdi-Hasan hat das heute übernommen. Offenresource-documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
TarteelAI/quranic-universal-library#1020 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100