Sign inSign up

cytopia/phpcs

By cytopia

•Updated over 3 years ago

Alpine-based multistage-build version of phpcs for reproducible usage in CI

Image
5

1M+

cytopia/phpcs repository overview

⁠Docker image for phpcs

Tag License

lint build nightly

View Dockerfiles⁠ on GitHub.

Available Architectures: amd64, i386, arm64, arm/v7, arm/v6

Tiny Alpine-based multistage-builld dockerized version of phpcs⁠[1]. The image is built nightly against multiple stable versions and pushed to Dockerhub.

[1] Official project: https://github.com/squizlabs/PHP_CodeSniffer⁠

⁠:whale: Available Docker image versions

Docker

⁠Rolling releaess

The following Docker image tags are rolling releases and are built and updated every night.

nightly

Docker TagGit RefPHPCSPHPAvailable Architectures
latestmasterlatestlatestamd64, i386, arm64, arm/v7, arm/v6
latest-php8.1masterlatest8.1amd64, i386, arm64, arm/v7, arm/v6
latest-php8.0masterlatest8.0amd64, i386, arm64, arm/v7, arm/v6
latest-php7.4masterlatest7.4amd64, i386, arm64, arm/v7, arm/v6
latest-php7.3masterlatest7.3amd64, i386, arm64, arm/v7, arm/v6
latest-php7.2masterlatest7.2amd64, i386, arm64, arm/v7, arm/v6
latest-php7.1masterlatest7.1amd64, i386, arm64, arm/v7, arm/v6
latest-php7.0masterlatest7.0amd64, i386, arm64, arm/v7, arm/v6
latest-php5.6masterlatest5.6amd64, i386, arm64, arm/v7, arm/v6
3master3.x.xlatestamd64, i386, arm64, arm/v7, arm/v6
3-php8.1master3.x.x8.1amd64, i386, arm64, arm/v7, arm/v6
3-php8.0master3.x.x8.0amd64, i386, arm64, arm/v7, arm/v6
3-php7.4master3.x.x7.4amd64, i386, arm64, arm/v7, arm/v6
3-php7.3master3.x.x7.3amd64, i386, arm64, arm/v7, arm/v6
3-php7.2master3.x.x7.2amd64, i386, arm64, arm/v7, arm/v6
3-php7.1master3.x.x7.1amd64, i386, arm64, arm/v7, arm/v6
3-php7.0master3.x.x7.0amd64, i386, arm64, arm/v7, arm/v6
3-php5.6master3.x.x5.6amd64, i386, arm64, arm/v7, arm/v6
2master2.x.xlatestamd64, i386, arm64, arm/v7, arm/v6
2-php8.1master2.x.x8.1amd64, i386, arm64, arm/v7, arm/v6
2-php8.0master2.x.x8.0amd64, i386, arm64, arm/v7, arm/v6
2-php7.4master2.x.x7.4amd64, i386, arm64, arm/v7, arm/v6
2-php7.3master2.x.x7.3amd64, i386, arm64, arm/v7, arm/v6
2-php7.2master2.x.x7.2amd64, i386, arm64, arm/v7, arm/v6
2-php7.1master2.x.x7.1amd64, i386, arm64, arm/v7, arm/v6
2-php7.0master2.x.x7.0amd64, i386, arm64, arm/v7, arm/v6
2-php5.6master2.x.x5.6amd64, i386, arm64, arm/v7, arm/v6
⁠Point in time releases

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.

build

Docker TagGit RefPHPCSPHPAvailable Architectures
latest-<tag>git: <tag>latestlatestamd64, i386, arm64, arm/v7, arm/v6
latest-php8.1-<tag>git: <tag>latest8.1amd64, i386, arm64, arm/v7, arm/v6
latest-php8.0-<tag>git: <tag>latest8.0amd64, i386, arm64, arm/v7, arm/v6
latest-php7.4-<tag>git: <tag>latest7.4amd64, i386, arm64, arm/v7, arm/v6
latest-php7.3-<tag>git: <tag>latest7.3amd64, i386, arm64, arm/v7, arm/v6
latest-php7.2-<tag>git: <tag>latest7.2amd64, i386, arm64, arm/v7, arm/v6
latest-php7.1-<tag>git: <tag>latest7.1amd64, i386, arm64, arm/v7, arm/v6
latest-php7.0-<tag>git: <tag>latest7.0amd64, i386, arm64, arm/v7, arm/v6
latest-php5.6-<tag>git: <tag>latest5.6amd64, i386, arm64, arm/v7, arm/v6
git: <tag>
3-<tag>git: <tag>3.x.xlatestamd64, i386, arm64, arm/v7, arm/v6
3-php8.1-<tag>git: <tag>3.x.x8.1amd64, i386, arm64, arm/v7, arm/v6
3-php8.0-<tag>git: <tag>3.x.x8.0amd64, i386, arm64, arm/v7, arm/v6
3-php7.4-<tag>git: <tag>3.x.x7.4amd64, i386, arm64, arm/v7, arm/v6
3-php7.3-<tag>git: <tag>3.x.x7.3amd64, i386, arm64, arm/v7, arm/v6
3-php7.2-<tag>git: <tag>3.x.x7.2amd64, i386, arm64, arm/v7, arm/v6
3-php7.1-<tag>git: <tag>3.x.x7.1amd64, i386, arm64, arm/v7, arm/v6
3-php7.0-<tag>git: <tag>3.x.x7.0amd64, i386, arm64, arm/v7, arm/v6
3-php5.6-<tag>git: <tag>3.x.x5.6amd64, i386, arm64, arm/v7, arm/v6
git: <tag>
2-<tag>git: <tag>2.x.xlatestamd64, i386, arm64, arm/v7, arm/v6
2-php8.1-<tag>git: <tag>2.x.x8.1amd64, i386, arm64, arm/v7, arm/v6
2-php8.0-<tag>git: <tag>2.x.x8.0amd64, i386, arm64, arm/v7, arm/v6
2-php7.4-<tag>git: <tag>2.x.x7.4amd64, i386, arm64, arm/v7, arm/v6
2-php7.3-<tag>git: <tag>2.x.x7.3amd64, i386, arm64, arm/v7, arm/v6
2-php7.2-<tag>git: <tag>2.x.x7.2amd64, i386, arm64, arm/v7, arm/v6
2-php7.1-<tag>git: <tag>2.x.x7.1amd64, i386, arm64, arm/v7, arm/v6
2-php7.0-<tag>git: <tag>2.x.x7.0amd64, i386, arm64, arm/v7, arm/v6
2-php5.6-<tag>git: <tag>2.x.x5.6amd64, i386, arm64, arm/v7, arm/v6

Where <tag> refers to the chosen git tag from this repository.

⁠:open_file_folder: Docker mounts

The working directory inside the Docker container is /data/ and should be mounted locally.

⁠:computer: Usage

⁠Basic
$ docker run --rm -v $(pwd):/data cytopia/phpcs .

----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
 2 | ERROR | [ ] Missing file doc comment
 5 | ERROR | [x] First condition of a multi-line IF statement must
   |       |     directly follow the opening parenthesis
 6 | ERROR | [x] Line indented incorrectly; expected at least 4
   |       |     spaces, found 1
 6 | ERROR | [x] Closing brace must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
⁠Custom standard

Custom standards must be mounted inside the container to /usr/bin/CodeSniffer.conf

# Via command line
$ docker run --rm -v $(pwd):/data -v CodeSniffer.conf:/usr/bin/CodeSniffer.conf cytopia/phpcs .
# Docker compose
phpcs:
  image: cytopia/phpcs
  volumes:
    - .:/data
    - CodeSniffer.conf:/usr/bin/CodeSniffer.conf
⁠Docker images

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:

GitHubDockerHubTypeDescription
awesome-ci⁠aci-hub-imgBasicTools for git, file and static source code analysis
file-lint⁠flint-hub-imgBasicBaisc source code analysis
linkcheck⁠linkcheck-hub-imgBasicSearch for URLs in files and validate their HTTP status code
ansible⁠ansible-hub-imgAnsibleMultiple versions and flavours of Ansible
ansible-lint⁠alint-hub-imgAnsibleLint Ansible
gofmt⁠gfmt-hub-imgGoFormat Go source code [1]
goimports⁠gimp-hub-imgGoFormat Go source code [1]
golint⁠glint-hub-imgGoLint Go code
eslint⁠elint-hub-imgJavascriptLint Javascript code
jsonlint⁠jlint-hub-imgJSONLint JSON files [1]
kubeval⁠kubeval-hub-imgK8sLint Kubernetes files
checkmake⁠cm-hub-imgMakeLint Makefiles
phpcbf⁠pcbf-hub-imgPHPPHP Code Beautifier and Fixer
phpcs⁠pcs-hub-imgPHPPHP Code Sniffer
phplint⁠plint-hub-imgPHPPHP Code Linter [1]
php-cs-fixer⁠pcsf-hub-imgPHPPHP Coding Standards Fixer
bandit⁠bandit-hub-imgPythonA security linter from PyCQA
black⁠black-hub-imgPythonThe uncompromising Python code formatter
mypy⁠mypy-hub-imgPythonStatic source code analysis
pycodestyle⁠pycs-hub-imgPythonPython style guide checker
pydocstyle⁠pyds-hub-imgPythonPython docstyle checker
pylint⁠pylint-hub-imgPythonPython source code, bug and quality checker
terraform-docs⁠tfdocs-hub-imgTerraformTerraform doc generator (TF 0.12 ready) [1]
terragrunt⁠tg-hub-imgTerraformTerragrunt and Terraform
terragrunt-fmt⁠tgfmt-hub-imgTerraformterraform fmt for Terragrunt files [1]
yamlfmt⁠yfmt-hub-imgYamlFormat Yaml files [1]
yamllint⁠ylint-hub-imgYamlLint Yaml files

[1] Uses a shell wrapper to add enhanced functionality not available by original project.

⁠Makefiles

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.

⁠:page_facing_up: License

MIT License⁠

Copyright (c) 2019 cytopia⁠

Tag summary

Content type

Image

Digest

sha256:54e3dab58…

Size

33.6 MB

Last updated

over 3 years ago

docker pull cytopia/phpcs