Skip to content

Commit b1b2865

Browse files
authored
chore: add vscode settings for linting (#9)
* chore: add vscode settings for linting * Update README.md * chore: add xdebug conf
1 parent d692598 commit b1b2865

File tree

8 files changed

+46
-3
lines changed

8 files changed

+46
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
.idea/
33
wordpress
44
.wordpress/
5+
.vscode/

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Listen for Xdebug",
6+
"type": "php",
7+
"request": "launch",
8+
"port": 9003,
9+
"xdebugSettings": {
10+
"max_children": 128,
11+
"max_data": 1024,
12+
"max_depth": 3,
13+
"show_hidden": 1
14+
},
15+
"pathMappings": {
16+
"/var/www/html/wp-content/plugins/wp-graphql-filter-query": "${workspaceFolder}",
17+
"/var/www/html": "${workspaceFolder}/.wordpress/wordpress",
18+
}
19+
}
20+
]
21+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"phpcs.standard": "./.phpcs.xml.dist",
3+
"phpcs.ignorePatterns": ["vendor"],
4+
"phpcs.executablePath": "./vendor/bin/phpcs",
5+
"phpcbf.onsave": true,
6+
"phpcbf.executablePath": "vendor/bin/phpcbf",
7+
"phpcbf.configSearch": true,
8+
"phpSniffer.autoDetect": true,
9+
"editor.formatOnSaveTimeout": 5000,
10+
"phpcbf.debug": true,
11+
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG PLUGIN_NAME=wp-graphql-filter-query
77
ARG php_ini_file_path="/usr/local/etc/php/php.ini"
88

99
# Setup the OS
10-
RUN apt-get -qq update ; apt-get -y install unzip curl sudo subversion mariadb-client \
10+
RUN apt-get -qq update ; apt-get -y install unzip curl sudo subversion mariadb-client less \
1111
&& apt-get autoclean \
1212
&& chsh -s /bin/bash www-data
1313

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PLUGIN_DIR=/var/www/html/wp-content/plugins/wp-graphql-filter-query
2-
BIN_DIR=$(PLUGIN_DIR)/bin/
2+
BIN_DIR=$(PLUGIN_DIR)/bin
33
COMPOSER=docker run --rm -it -v `pwd`:/app -w /app composer
44
DC=docker-compose
55

@@ -21,6 +21,7 @@ run:
2121
$(DC) up -d
2222
$(DC) exec wp $(BIN_DIR)/wait-for-it.sh db:3306
2323
$(DC) exec wp install-wp-tests
24+
$(DC) cp wp:/tmp/wordpress-tests-lib `pwd`/.wordpress/wordpress-tests-lib
2425

2526
down:
2627
$(DC) down --volumes

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@ make test
2727
```
2828
make lint
2929
```
30+
31+
### vscode
32+
33+
Install the following plugins to gain formatting and lint errors showing up in the editor
34+
35+
![image](https://user-images.githubusercontent.com/24898309/174314127-6238f618-0355-4187-b43c-c7a81f451c5f.png)
36+

bin/setup-wp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
WP_REQUIRED_PLUGINS="wp-graphql query-monitor"
44

5+
wp core download
6+
57
if ! $(wp core is-installed); then
68
echo "Waiting for MySQL..."
79
wp core install --url=http://localhost:8080 --title=Example --admin_user=admin --admin_password=admin --admin_email=admin@example.com --path=/var/www/html

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
define('WP_HOME', 'http://' . $$_SERVER['HTTP_HOST'] );
2929
define('WP_DEBUG_LOG', true);
3030
volumes:
31-
# - wp-data:/var/www/html
31+
- ./.wordpress/wordpress:/var/www/html
3232
- ./:/var/www/html/wp-content/plugins/wp-graphql-filter-query
3333
ports:
3434
- 8080:80

0 commit comments

Comments
 (0)