Skip to content

Commit

Permalink
chore(CPNT-2249): address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanrajpac committed Jan 9, 2024
1 parent b5bb4b7 commit 0564477
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
14 changes: 14 additions & 0 deletions NewsUK/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
<config name="minimum_supported_wp_version" value="6.2" />
<config name="testVersion" value="8.2-"/>

<rule ref="PHPCompatibilityWP" />

<rule ref="WordPress-Docs">
<severity>5</severity>
</rule>
<rule ref="WordPress-Extra">
<severity>5</severity>
</rule>
<rule ref="WordPress-Core">
<severity>5</severity>
</rule>
<rule ref="WordPress-VIP-Go">
<severity>5</severity>
</rule>
Expand Down Expand Up @@ -50,6 +55,12 @@
<severity>0</severity>
</rule>

<rule ref="PSR2.Namespaces.UseDeclaration">
<exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations" />
</rule>
<rule ref="PSR2R.Namespaces.UnusedUseStatement" />
<rule ref="PSR2R.Namespaces.UseInAlphabeticalOrder" />

<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
Expand All @@ -59,6 +70,9 @@

<arg name="colors"/>

<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20" />

<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/cypress/*</exclude-pattern>
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Create a `phpcs.xml.dist` file in your project and add the following:
<rule ref="NewsUK"/>
</ruleset>
```
💡 *It is recommended to use the `NewsUK` ruleset as it is without customising or overriding rules unless necessary.*

## Override or add custom rules
You can also override or add custom rules to the config as follows.
Expand All @@ -45,6 +46,6 @@ You can also override or add custom rules to the config as follows.
Add the following to `scripts` section in `composer.json` file to run linting.

```json
"phpcs": "phpcs .",
"phpcbf": "phpcbf .",
"lint": "phpcs .",
"lint:fix": "phpcbf .",
```

0 comments on commit 0564477

Please sign in to comment.