PHP CS Fixer via Docker di dalam WSL untuk Visual Studio Code

9  
       

Sebelum memulai pastikan WSL sudah terinstall dan dapat diakses.

Pertama-tama jalankan WSL. Kemudian, buat file baru di folder home current user.


nano ~/php-cs-fixer-docker.sh

Copy paste code dibawah ini

#!/bin/bash
# Mount the current working directory to the exact same path in the container
docker run --rm -i \
-u "$(id -u):$(id -g)" \
-v "$PWD:$PWD" \
-w "$PWD" \
ghcr.io/php-cs-fixer/php-cs-fixer:3.95.29-php8.5 "$@"

Kemudian ubah permission-nya supaya menjadi executable.
chmod +x ~/php-cs-fixer-docker.sh

Setelah itu install extension VS Code yang bernama PHP CS FIXER dari Junstyle.

Pada bagian php-cs-fixer executable isi
~/php-cs-fixer-docker.sh

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>