Get Started
#
Install dependencies#
goThe code base is in go, meaning we need a working go setup before we can do anything else. Have a look at the go guide to get up and running with go in no time!
#
golangci-lintTo make sure we keep on writing quality code, golang-ci lint is used to validate the changes. Have a look at the local installation guide to make sure you can validate this yourself as well.
#
go-bindataOh my Posh packs the initialization scipts for the different shells, but go does not ship with the ability to add files other than go code to your compiled binary. go-bindata allows us to add initialization files and ship them in the source code to easily bootstrap your shell with Oh my Posh.
There are multiple ways to install go-bindata.
- homebrew
- linux
- source
Be careful as executing this inside the Oh my Posh repository will adjust the go.mod
file with this dependency.
Today, there's no way to install a dependency system wide for go, although that's in the works.
Make sure to remove this before submitting a PR as there's a check in place to avoid adding unused dependencies.
#
Get the source codeThe source is hosted on Github. When you want to contribute, create a fork so you can make changes in your repository and create pull request in the official Oh my Posh repository.
Clone your fork of Oh my Posh locally, replace <user>
with your Github username.
#
Running testsThe go source code can be found in the src/
directory, make sure to change to that one before continuing.
#
Unit tests#
golangci-lint#
Building the appThe easiest way to validate your changes is to write tests. Unfortunately, as it's a visual tool, you'll want to validate
the changes by running the prompt in your shell as well. You can make use of go's bin
folder which is usually added to
your path to add your own Oh my Posh binary to and immediately see the changes appear in your shell.
#
Get an editorA default config(.vscode folder) for Visual Studio Code is available in the repo:
golangci-lint is configured as the default linter.
Recommended extensions available for a smooth bootstrap.
Default run and debug configurations available.
Once the extensions are installed:
- Debug can be started by hitting F5.
- All tests can be run using the Test explorer.
#
Extra tips#
Configure Delve in VS CodeDelve config is restrictive by default(string limit especially). You can expand some limits in VS Code(settings.json
or directly in launch.json
):
#
Up NextWith everything set up, you're ready to start making changes and create your first PR!