harrisoncramer / harrisoncramer/gitlab.nvim

[Feature]: Enable setting `create_mr.title` in as function in `setup` options

Offen
#516 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature request
Vorherrschende Sprache
Lua
Sterne
401
Forks
62
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
2

Beschreibung

Thanks for gitlab.nvim! Just started using this plugin today and I think it will be incredibly useful for my workflow.

Feature Description

After referencing :h gitlab.nvim, I can see that we can set the title for Merge Requests using require("gitlab").create_mr({ title = "Fix bug XYZ", description = "Closes #123" }), but we cannot set MR titles in the setup options.

This makes sense, because it would rarely be useful to always use the same title for every Merge Request, but I think it would be a useful option if not only users were able to also set settings.create_mr.title within our setup configuration to gitlab.nvim, but we were able to set the title by providing a function that will be called to generate the title - so this is sort of 2 feature requests.

  1. To allow users to configure settings.create_mr.title within the setup options and
  2. To allow users to provide a lua function to this property, that, when called will return a string that can be used for the GitLab MR.

Ideal Behavior

return {
	"harrisoncramer/gitlab.nvim",
	dependencies = {
		"MunifTanjim/nui.nvim",
		"nvim-lua/plenary.nvim",
		"sindrets/diffview.nvim",
		"stevearc/dressing.nvim",
		"nvim-tree/nvim-web-devicons",
	},
	build = function()
		require("gitlab.server").build(true)
	end, -- Builds the Go binary
	config = function()
		require("gitlab").setup({
			create_mr = {
				target = "main",
				template_file = "Default.md",
				title = function()
					-- My complicated function that will use some runtime logic to return a string to use for MR title
					return "foo(bar): baz"
				end,
			},
		})
	end,
}

Thanks again!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Einrichtungsdokumentation in doc/gitlab.nvim.txt und verfolge die im Issue beschriebenen Einstiegspunkte require(\"gitlab\").setup und create_mr. Als erledigt gilt die Aufgabe, wenn settings.create_mr.title einen String oder eine Lua-Funktion akzeptiert und der resultierende String für den Titel des GitLab Merge Request verwendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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