Skip to content

Commit

Permalink
Improve / relocate PHPCS stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Dec 11, 2024
1 parent 51af67d commit 0ae77a8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 28 deletions.
4 changes: 2 additions & 2 deletions modules/system/console/WinterSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ protected function createConfigFile(): void
'plugin' => $this->getPluginIdentifier(),
'plugin_code' => str_replace('.', '_', $this->getPluginIdentifier()),
];
$this->makeStub('scaffold/phpcs/phpcs.xml.stub');
$this->makeStub('scaffold/phpcs/phpcs.plugin.xml.stub');
return;
}

File::copy(
__DIR__ . '/scaffold/phpcs/phpcs.core.xml.stub',
__DIR__ . '/scaffold/phpcs/phpcs.project.xml.stub',
$this->option('config') ?? base_path('phpcs.xml')
);
}
Expand Down
24 changes: 0 additions & 24 deletions modules/system/console/scaffold/phpcs/phpcs.core.xml.stub

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<description>Coding style for {{ plugin }}.</description>

<!-- Import Winter CMS code style ruleset -->
<rule ref="./phpcs.base.xml" />
<rule ref="../../../modules/system/phpcs.base.xml" />

<arg name="extensions" value="php" />
<arg name="colors" />
Expand Down
16 changes: 16 additions & 0 deletions modules/system/console/scaffold/phpcs/phpcs.project.xml.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<ruleset name="MyWinterProject">
<description>The coding standard for this project, powered by Winter CMS.</description>

<!-- Import Winter CMS core code style ruleset -->
<rule ref="./modules/system/phpcs.base.xml" />

<arg name="extensions" value="php" />
<arg name="colors" />

<file>config/</file>
<!-- <file>plugins/myauthor/*</file> -->

<!-- Ignore vendor files -->
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>
File renamed without changes.
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<description>The coding standard for Winter CMS core.</description>

<!-- Import Winter CMS code style ruleset -->
<rule ref="./phpcs.base.xml" />
<rule ref="./modules/system/phpcs.base.xml" />

<arg name="extensions" value="php" />
<arg name="colors" />
Expand Down

0 comments on commit 0ae77a8

Please sign in to comment.