Skip to content

0.4.0

Compare
Choose a tag to compare
@svengreb svengreb released this 11 Dec 19:46
· 42 commits to main since this release
v0.4.0

Release Date: 2020-12-11 Project Board Milestone

Show all commits

This release version introduces a new task for the “mvdan.cc/gofumpt“ Go module command.

Features

Task for “mvdan.cc/gofumpt“ Go module command#56#57 (⊶ 3273e91)

↠ The mvdan.cc/gofumpt Go module provides the gofumpt command, a tool that enforces a stricter format than gofmt and provides additional rules, while being backwards compatible. It is a modified fork of gofmt so it can be used as a drop-in replacement.

To configure and run the gofumpt command, a new task.GoModule has been implemented in the new gofumpt package that can be run using the gobin command runner or any other command runner that handles tasks of kind KindGoModule.

The task is customizable through the following functions:

  • WithEnv(map[string]string) gofumpt.Option — sets the task specific environment.
  • WithExtraArgs(...string) gofumpt.Option — sets additional arguments to pass to the command.
  • WithExtraRules(bool) gofumpt.Option — indicates whether gofumpt‘s extra rules should be enabled. See the repository documentation for a listing of available rules.
  • WithListNonCompliantFiles(bool) gofumpt.Option — indicates whether files, whose formatting are not conform to the style guide, are listed.
  • WithModulePath(string) gofumpt.Option — sets the module import path.
  • WithModuleVersion(*semver.Version) gofumpt.Option — sets the module version.
  • WithPaths(...string) gofumpt.Option — sets the paths to search for Go source files. By default all directories are scanned recursively starting from the current working directory.
  • WithReportAllErrors(bool) gofumpt.Option — indicates whether all errors should be printed instead of only the first 10 on different lines.
  • WithSimplify(bool) gofumpt.Option — indicates whether code should be simplified.

The “elder“ reference implementation provides the new Gofumpt method.

The full changelog is available in the repository


Copyright © 2019-present Sven Greb