#author("2021-04-20T08:01:48+09:00","default:nobuoki","nobuoki")
#author("2021-04-20T21:47:55+09:00","default:nobuoki","nobuoki")
* 結論 [#icc01b36]

[[unibeautify/php-cs-fixer>https://hub.docker.com/r/unibeautify/php-cs-fixer]] がおすすめです (2021/04/20)
以前は自力でコンテナ化を試みましたが(旧ページ名:vm/php-cs-fixerをコンテナ化してみた)
今となっては[[unibeautify/php-cs-fixer>https://hub.docker.com/r/unibeautify/php-cs-fixer]] がおすすめです (2021/04/20)

#prism(bash){{{
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

----

以下、古い記事

* 作る [#k20091de]

#prism(bash){{{
podman build https://gist.github.com/kemasoft-gist/b0fecd9578e46aac97f1129bfa752950/raw -t kemasoft/php-cs-fixer
}}}

* 使う [#tca145a4]

#prism(bash){{{
# カレントディレクトリ以下のファイルを全て fix する
# コンテナの中から見ると /mnt 以下が対象になる
podman run --rm -v .:/mnt kemasoft/php-cs-fixer php-cs-fixer fix /mnt
}}}

* 楽に呼び出す [#gffb79fc]

#prism(bash){{{
# alias定義
alias csfix="podmanr run --rm -v .:/mnt kemasoft/php-cs-fixer php-cs-fixer"

# 上と同じことをするにはこう
csfix fix /mnt
}}}

* Dockerfile [#zc9b5a68]

#gist(kemasoft-gist/b0fecd9578e46aac97f1129bfa752950)

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS