Skip to content

Commit

Permalink
Merge pull request #1 from sarahcssiqueira/develop
Browse files Browse the repository at this point in the history
feat: wpcs by project with composer and rules set up on phpcs.xml
  • Loading branch information
sarahcssiqueira committed Dec 1, 2023
2 parents ceb636e + a7af36e commit e64943a
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/vendor/
.DS_Store
.phpcs.cache
composer.lock
composer.lock
40 changes: 40 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<ruleset name="CS">
<description>XYWZ Blocks</description>
<config name="testVersion" value="5.6-"/>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>

<arg value="ps"/>
<arg name="colors"/>
<arg name="parallel" value="100"/>
<arg name="extensions" value="php"/>
<arg name="cache" value=".phpcs.cache"/>

<rule ref="WordPress">
<!-- PSR4 -->
<exclude name="WordPress.Files.FileName" />
</rule>

<rule ref="WordPress-Extra"/>

<rule ref="WordPress-Docs"/>

<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="3"/>
<property name="absoluteComplexity" value="5"/>
</properties>
</rule>

<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="absoluteNestingLevel" value="3"/>
</properties>
</rule>

<rule ref="Generic.Arrays.DisallowShortArraySyntax.Found">
<severity>0</severity>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found"/>
</ruleset>
32 changes: 32 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "sarahcssiqueira/xywz-blocks",
"description": "Custom Gutenberg blocks.",
"license": "GPL-2.0+",
"type": "wordpress-plugin",
"authors": [
{
"name": "sarahcssiqueira",
"email": "sarahcosiqueira@gmail.com",
"homepage": "https://sarahjobs.com"
}
],
"support": {
"src": "https://github.com/sarahcssiqueira/xywz-blocks",
"issues": "https://github.com/sarahcssiqueira/xywz-blocks/issues"
},
"autoload": {
"psr-4": {
"XYWZBlocks\\Inc\\": "./inc"
}
},
"scripts": {
"cstd": "./vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
"cs": "./vendor/bin/phpcs --standard=.phpcs.xml --report=summary .",
"cbf": "./vendor/bin/phpcbf --standard=.phpcs.xml ."
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.7",
"wp-coding-standards/wpcs": "^2.3",
"phpcompatibility/php-compatibility": "^9.3"
}
}
189 changes: 189 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e64943a

Please sign in to comment.