Last active
February 18, 2022 21:27
-
-
Save cored0wn/26baf98ccf84ccd9682771d549e1222c to your computer and use it in GitHub Desktop.
phpcs docker vscode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:cli-alpine | |
MAINTAINER Christopher Wittor <[email protected]> | |
RUN apk --no-cache add git | |
WORKDIR /tmp | |
RUN curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar && \ | |
cp /tmp/phpcs.phar /usr/local/bin/phpcs && \ | |
chmod +x /usr/local/bin/phpcs | |
WORKDIR / | |
RUN git clone -b master https://github.com/WordPress/WordPress-Coding-Standards.git /opt/wpcs && \ | |
phpcs --config-set installed_paths /opt/wpcs | |
RUN phpcs --config-set show_progress 1 && \ | |
phpcs --config-set colors 1 && \ | |
phpcs --config-set report_width 140 && \ | |
phpcs --config-set encoding utf-8 | |
ENTRYPOINT ["phpcs"] | |
CMD ["--version"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Works on Mac mini M1 | |
p=$(echo "$@" | sed "s,--stdin-path=,,") | |
docker run -v $(pwd):$(pwd) -w=$(pwd) --rm phpcs $p | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment