-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This installs PHPCS and some nice addon standards to be used as GitHub Action.
- Loading branch information
Showing
12 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*~ | ||
*.swp |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[submodule "phpcs/phpcs-core"] | ||
path = thirdparty/phpcs-core | ||
url = https://github.com/PHPCSStandards/PHP_CodeSniffer/ | ||
[submodule "phpcs/phpcompatibility"] | ||
path = thirdparty/phpcompatibility | ||
url = https://github.com/PHPCompatibility/PHPCompatibility | ||
[submodule "phpcs/phpcsutils"] | ||
path = thirdparty/phpcsutils | ||
url = https://github.com/PHPCSStandards/PHPCSUtils | ||
[submodule "phpcs/phpcsextra"] | ||
path = thirdparty/phpcsextra | ||
url = https://github.com/PHPCSStandards/PHPCSExtra | ||
[submodule "thirdparty/security"] | ||
path = thirdparty/security | ||
url = https://github.com/FloeDesignTechnologies/phpcs-security-audit | ||
[submodule "thirdparty/wordpress"] | ||
path = thirdparty/wordpress | ||
url = https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ghcr.io/seravo/ubuntu:noble | ||
|
||
RUN apt-setup && \ | ||
apt-get --assume-yes install \ | ||
php-cli \ | ||
php-xml && \ | ||
apt-cleanup | ||
|
||
RUN useradd user | ||
|
||
# Install PHP CodeSniffer with WordPress and Security standards | ||
# NOTE! PHP CodeSniffer master is development version, so one must use latest tagged version instead | ||
RUN mkdir -p /usr/share/php/PHP | ||
COPY thirdparty/phpcs-core /usr/share/php/PHP/CodeSniffer | ||
COPY thirdparty/wordpress /usr/share/php/PHP/CodeSniffer/src/Standards/ | ||
COPY thirdparty/security /usr/share/php/PHP/CodeSniffer/src/Standards/ | ||
COPY thirdparty/phpcompatibility /usr/share/php/PHP/CodeSniffer/src/Standards/ | ||
COPY thirdparty/phpcsutils /usr/share/php/PHP/CodeSniffer/src/Standards/ | ||
COPY thirdparty/phpcsextra /usr/share/php/PHP/CodeSniffer/src/Standards/ | ||
|
||
USER user | ||
|
||
ENTRYPOINT ["/usr/bin/php", "/usr/share/php/PHP/CodeSniffer/bin/phpcs"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
DOCKER = docker | ||
IMAGE = ghcr.io/seravo/phpcs:latest | ||
|
||
all: | ||
|
||
build: | ||
$(DOCKER) build -t $(IMAGE) . | ||
|
||
run: | ||
$(DOCKER) run --rm -it $(IMAGE) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: "Run PHPCS linter" | ||
description: "Lint code using PHPCS" | ||
|
||
inputs: | ||
rules: | ||
description: "PHPCS args" | ||
required: true | ||
default: '' | ||
|
||
runs: | ||
using: "docker" | ||
image: "Dockerfile" | ||
args: | ||
- ${{ inputs.args }} |
Submodule phpcompatibility
added at
9fb324
Submodule phpcs-core
added at
8f90f7
Submodule phpcsextra
added at
11d387
Submodule phpcsutils
added at
87b233