Skip to main content

Registry Style Guide

caution

If you develop your custom registry, you don't have to conform this style guide. But the guide would be useful to write good and consistent configuration.

Scaffold configuration by aqua gr command

First, we recommend to scaffold configuration by aqua gr command.

Scaffold Registry Configuration.

Format with prettier

https://prettier.io/

$ npm i -g prettier
$ prettier -w registry.yaml

Remove spaces in the template {{ and }}

👍

asset: tfcmt_{{.OS}}_{{.Arch}}.tar.gz

👎

asset: tfcmt_{{ .OS }}_{{ .Arch }}.tar.gz

Remove characters .! from the end of the description

👍

description: A command-line tool that makes git easier to use with GitHub

👎

description: A command-line tool that makes git easier to use with GitHub.

Trim spaces

👍

description: A command-line tool that makes git easier to use with GitHub

👎

description: "  A command-line tool that makes git easier to use with GitHub  "

Remove unneeded quotes of strings

👍

description: A command-line tool that makes git easier to use with GitHub

👎

description: "A command-line tool that makes git easier to use with GitHub"

Avoid if and for statement in templates

👍

asset: foo.{{.Format}}
format: tar.gz
overrides:
- goos: windows
format: zip

👎

asset: 'foo.{{if eq .GOOS "windows"}}zip{{else}}tar.gz{{end}}'

version_overrides Style Guide

e.g.

# Latest setting
version_constraint: semver(">= 5.0.0")
version_overrides:
- version_constraint: semver(">= 4.0.0")
# ...
- version_constraint: semver(">= 3.0.0")
# ...
- version_constraint: "true" # Oldest setting

If the format is raw, files[].src isn't needed

👍

format: raw
files:
- name: swagger

👎

format: raw
files:
- name: swagger
src: swagger_{{.OS}}_{{.Arch}} # unneeded

Consideration about Rust

⚠️ The author @suzuki-shunsuke isn't familiar with Rust. If you have any opinion, please let us know.

👍

replacements:
linux: unknown-linux-musl
windows: pc-windows-msvc

👎

replacements:
linux: unknown-linux-gnu
windows: pc-windows-gnu

Use overrides instead of format_overrides

👍

format: tar.gz
overrides:
- goos: windows
format: zip

👎

format: tar.gz
format_overrides:
- goos: windows
format: zip

Don't use emojis as much as possible

In some environments, emojis are corrupted. e.g. https://github.com/aquaproj/aqua/pull/1004#issuecomment-1183710603

👍

description: CLI and Go library for CODEOWNERS files

👎

description: 🔒 CLI and Go library for CODEOWNERS files

Omit the setting which is equivalent to the default value

When repo_owner and repo_name are set, you can omit some attributes.

👍

repo_owner: weaveworks
repo_name: eksctl

👎

repo_owner: weaveworks
repo_name: eksctl
name: weaveworks/eksctl
link: https://github.com/weaveworks/eksctl
files:
- name: eksctl

Use aliases only for keeping the compatibility

Please see here

Use supported_envs rather than supported_if

Please see the caution.

Select type according to the following order

  1. github_release
  2. github_content
  3. github_archive
  4. http
  5. go_install

For example, you can also use http type to install the package from GitHub Releases, but in that case you should use github_release rather than http.

Use go_install rather than go

Please see the caution.