unibeautify/php-cs-fixer がおすすめです (2021/04/20)
docker run -it -v "$(pwd)":/workdir -w /workdir unibeautify/php-cs-fixer fix ./
色々な言語のフォーマッタがコンテナ化されています
ありがたく使わせていただきましょう
autopep8, beautysh, black, brittany, ClangFormat, Crystal, elm-format, goimports, ocp-indent, php-cs-fixer, phpcbf, puppet-lint, Rscript, rubocop, ruby-beautify, sass-convert, sqlformat, uncrustify
以下、古い記事
podman build https://gist.github.com/kemasoft-gist/b0fecd9578e46aac97f1129bfa752950/raw -t kemasoft/php-cs-fixer
# カレントディレクトリ以下のファイルを全て fix する
# コンテナの中から見ると /mnt 以下が対象になる
podman run --rm -v .:/mnt kemasoft/php-cs-fixer php-cs-fixer fix /mnt
# alias定義
alias csfix="podmanr run --rm -v .:/mnt kemasoft/php-cs-fixer php-cs-fixer"
# 上と同じことをするにはこう
csfix fix /mnt