Skip to content

Commit

Permalink
Add PHP CodeSniffer and fix reported linting errors (#18)
Browse files Browse the repository at this point in the history
Adds PHP CodeSniffer to lint the codebase. Also auto fixes errors related to formatting. This change allows all developers to follow the same coding patterns and agree on new ones by changing the common ruleset.

- Uses composer to install code sniffer and required rules
- Add composer to Docker image
- Add phpcs rules for linting
- Update the contribution guide with information about linting the code
  • Loading branch information
sinukaarel authored Sep 26, 2024
1 parent 6fe34a0 commit d532dcb
Show file tree
Hide file tree
Showing 36 changed files with 3,170 additions and 2,536 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
logs/
vendor/
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM wordpress:6.6.2

# Install Composer.
RUN cd /tmp \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& mv composer.phar /usr/local/bin/composer

# Install required packages.
RUN apt-get update \
&& apt-get install -y \
Expand Down
Loading

0 comments on commit d532dcb

Please sign in to comment.