All #awesome-ci Docker images
ansible-lint • ansible • awesome-ci • bandit • black • checkmake • eslint • file-lint • gofmt • goimports • golint • jsonlint • kubeval • linkcheck • mypy • php-cs-fixer • phpcbf • phpcs • phplint • pycodestyle • pydocstyle • pylint • terraform-docs • terragrunt-fmt • terragrunt • yamlfmt • yamllint
View Dockerfiles on GitHub.
Available Architectures: amd64
, i386
, arm64
, arm/v7
Tiny Alpine-based multistage-build dockerized version of gofmt[1],
which adds the additional --ci
argument[2] via a shell wrapper to ensure to exit > 0 if file diffs occur.
The image is built nightly against multiple stable versions and pushed to Dockerhub.
- [1] Official project: https://godoc.org/cmd/gofmt
- [2] See Usage for help
The following Docker image tags are rolling releases and are built and updated every night.
Docker Tag | Git Ref | gofmt | Available Architectures |
---|---|---|---|
latest |
master | latest | amd64 , i386 , arm64 , arm/v7 |
The following Docker image tags are built once and can be used for reproducible builds. Its version never changes so you will have to update tags in your pipelines from time to time in order to stay up-to-date.
Docker Tag | Git Ref | gofmt | Available Architectures |
---|---|---|---|
latest-<tag> |
tag: <tag> |
latest | amd64 , i386 , arm64 , arm/v7 |
Where
<tag>
refers to the chosen git tag from this repository.
The working directory inside the Docker container is /data/
and should be mounted locally to
the root of your project.
$ docker run --rm cytopia/gofmt --help
Usage: cytopia/gofmt [flags] [path...]
cytopia/gofmt [--ci] [-r rule] [-se] [path...]
cytopia/gofmt --help
Dockerized version of gofmt with an addition to fail (exit 1) in case of file changes.
Additional wrapper features:
----------------------------
--ci This option will print the diff to stdout (similar to '-d') and if a diff
exists it will fail with exit 1.
Can only be combined with '-r rule', '-s' and '-e'.
To be used in continuous integration with explicit failing.
Default gofmt flages:
----------------------------
-d Do not print reformatted sources to standard output.
If a file's formatting is different than gofmt's, print diffs
to standard output.
-e Print all (including spurious) errors.
-l Do not print reformatted sources to standard output.
If a file's formatting is different from gofmt's, print its name
to standard output.
-r rule Apply the rewrite rule to the source before reformatting.
-s Try to simplify code (after applying the rewrite rule, if any).
-w Do not print reformatted sources to standard output.
If a file's formatting is different from gofmt's, overwrite it
with gofmt's version. If an error occurred during overwriting,
the original file is restored from an automatic backup.
# Print diff to stdout and exit 0
$ docker run --rm -v $(pwd):/data cytopia/gofmt -d .
# Print diff to stdout and exit > 0 if diff occurs
$ docker run --rm -v $(pwd):/data cytopia/gofmt --ci .
🔄 Related #awesome-ci projects
Save yourself from installing lot's of dependencies and pick a dockerized version of your favourite linter below for reproducible local or remote CI tests:
GitHub | DockerHub | Type | Description |
---|---|---|---|
awesome-ci | Basic | Tools for git, file and static source code analysis | |
file-lint | Basic | Baisc source code analysis | |
linkcheck | Basic | Search for URLs in files and validate their HTTP status code | |
ansible | Ansible | Multiple versions and flavours of Ansible | |
ansible-lint | Ansible | Lint Ansible | |
gofmt | Go | Format Go source code [1] | |
goimports | Go | Format Go source code [1] | |
golint | Go | Lint Go code | |
eslint | Javascript | Lint Javascript code | |
jsonlint | JSON | Lint JSON files [1] | |
kubeval | K8s | Lint Kubernetes files | |
checkmake | Make | Lint Makefiles | |
phpcbf | PHP | PHP Code Beautifier and Fixer | |
phpcs | PHP | PHP Code Sniffer | |
phplint | PHP | PHP Code Linter [1] | |
php-cs-fixer | PHP | PHP Coding Standards Fixer | |
bandit | Python | A security linter from PyCQA | |
black | Python | The uncompromising Python code formatter | |
mypy | Python | Static source code analysis | |
pycodestyle | Python | Python style guide checker | |
pydocstyle | Python | Python docstyle checker | |
pylint | Python | Python source code, bug and quality checker | |
terraform-docs | Terraform | Terraform doc generator (TF 0.12 ready) [1] | |
terragrunt | Terraform | Terragrunt and Terraform | |
terragrunt-fmt | Terraform | terraform fmt for Terragrunt files [1] |
|
yamlfmt | Yaml | Format Yaml files [1] | |
yamllint | Yaml | Lint Yaml files |
[1] Uses a shell wrapper to add enhanced functionality not available by original project.
Visit cytopia/makefiles for dependency-less, seamless project integration and minimum required best-practice code linting for CI. The provided Makefiles will only require GNU Make and Docker itself removing the need to install anything else.
Copyright (c) 2019 cytopia