arcticicestudio / snowsaw

A lightweight, plugin-driven and dynamic dotfiles bootstrapper.
MIT License
98 stars 8 forks source link

Project build & development toolchain #62

Closed arcticicestudio closed 5 years ago

arcticicestudio commented 5 years ago

Epic: #33 Depends on #58

Mage

The main project development and build toolchain for snowsaw will be Mage, a Make/rake-like build tool using Go. The magefile.go file will provide all relevant project tasks - from development and production builds, testing amd linting workflows, benchmarking up to code optimizations and asset handling.

Even though Go comes with a complete development/testing/deployment suite out-of-the-box, a project build tool ensures all commands always executed in the correct order and all necessary information are provided. Under the hood, the magefile file will make use of Go's official toolchain, but ensures consistency and a simple usage through Mage's UI features.

IntelliJ Development Setup

Next to the Mage this ticket will also add file watcher configurations for IntelliJ's official “File Watcher“ plugin. IntelliJ plus the official Go plugin is the recommended development IDE since it is the most complete and powerful for Go (as well as the most popular IDE for Java), providing a large amount of features. The official Go plugin makes IntelliJ feature-equal to Goland which is a "stripped down" version of IntelliJ's core engine only bundled with Go features.

GolangCI

To ensure a good code quality the Go ecosystem has hundreds of linters, each with a different purpose. Instead of installing and running multiple linters separately GolangCI provides a uniform interface to run most popular and useful linters in parallel and with many additional configuration features. The service is like many other great platforms free for open source projects. The actual runner golangci-lint is also open source and can be used locally as well in any private CI/CD pipelines. In order to use it for snowsaw, a .golangci.yml configuration file will be added and the runner will be executed through a lin Mage task.

Cross-Compilation

Go comes with all necessary tools to cross-compile out-of-the-box, but instead of running the commands manually gox will be used to also simplify this task as well as running and managing the compilation in parallel. To create distributions with and without binary artifact optimizations new Mage tasks will be added.

Formatting

To adhere to the Go code styleguide and conventions the official goimports tool will be used, executed through a dedicated _Mage task.

Testing

Go comes with all necessary testing tools out-of-the-box that be used through Mage tasks where a distinction is made between unit and integration tests as well as with and without coverage profiling. The coverage reports can be used later on to integrate services like CodeCov into snowsaw's CI/CD pipeline.

arcticicestudio commented 5 years ago

Resolved in 16221347756edf1a0619b6e795c354bb57be86e9