2 KiB
title | license | origin_url |
---|---|---|
Development environment | Apache-2.0 | ec1feedbf5/docs/content/development/hacking-on-gitea.en-us.md |
This page lists a few options to set up a productive development environment for working on Forgejo.
VS Codium
VS Codium is an open source version of the Visual Studio Code IDE. The Go integration for Visual Studio Code works with VS Codium and is a viable tool to work on Forgejo.
First, run cp -r contrib/ide/vscode .vscode
to create new directory .vscode
with the contents of folder contrib/ide/vscode at the root of the repository. Then, open the project directory in VS Codium.
You can now use Ctrl
+Shift
+B
to build the gitea executable and F5
to run it in debug mode.
Tests can be run by clicking on the run test
or debug test
button above their declaration.
Go code is formatted automatically when saved.
Emacs
Emacs has a Go mode that can likely be used to work on Forgejo's code base. Do you know how to configure it properly? Why not document that here?
Vim
Vim has a Go plugin that can likely be used to work on Forgejo's code base. Do you know how to configure it properly? Why not document that here?
GoLand
Clicking the Run Application
arrow on the function func main()
in /main.go
can quickly start a debuggable Gitea instance.
The Output Directory
in Run/Debug Configuration
MUST be set to the
gitea project directory (which contains main.go
and go.mod
),
otherwise, the started instance's working directory is a GoLand's temporary directory
and prevents Gitea from loading dynamic resources (eg: templates) in a development environment.
To run unit tests with SQLite in GoLand, set -tags sqlite,sqlite_unlock_notify
in Go tool arguments
of Run/Debug Configuration
.