Skip to content

Commit

Permalink
🔧 rename src directory to Silverstripe
Browse files Browse the repository at this point in the history
- the directory of the ruleset determines the name of the ruleset
  • Loading branch information
Cambis committed Jan 17, 2024
1 parent e371304 commit bf1ed9b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ruleset.xml → Silverstripe/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Silverstripe Bespoke" xsi:noNamespaceSchemaLocation="../../../vendor/squizlabs/php_codesniffer/phpcs.xsd">
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Silverstripe" xsi:noNamespaceSchemaLocation="../../../vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Coding standards for SilverStripe based project</description>

<!-- Don't sniff third party libraries -->
Expand Down
2 changes: 1 addition & 1 deletion bespoke-phpcbf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $_SERVER['argv'][] = 'app'; // scan app folder
if (file_exists(__DIR__ . '/../../../phpcs.xml')) {
$_SERVER['argv'][] = '--standard=phpcs.xml';
} else {
$_SERVER['argv'][] = '--standard=Silverstripe-Bespoke'; // rules
$_SERVER['argv'][] = '--standard=Silverstripe'; // rules
}
$_SERVER['argv'][] = '--extensions=php'; // only php files
$_SERVER['argv'][] = '--encoding=utf-8';
Expand Down
2 changes: 1 addition & 1 deletion bespoke-phpcs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $_SERVER['argv'][] = 'app'; // scan app folder
if (file_exists(__DIR__ . '/../../../phpcs.xml')) {
$_SERVER['argv'][] = '--standard=phpcs.xml';
} else {
$_SERVER['argv'][] = '--standard=Silverstripe-Bespoke'; // rules
$_SERVER['argv'][] = '--standard=Silverstripe'; // rules
}
$_SERVER['argv'][] = '--extensions=php'; // only php files
$_SERVER['argv'][] = '--encoding=utf-8';
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
},
"autoload": {
"psr-4": {
"Silverstripe\\": "src/"
"Silverstripe\\": "Silverstripe/"
}
},
"autoload-dev": {
"psr-4": {
"Silverstripe\\": "tests/"
}
},
"scripts": {
Expand Down
6 changes: 4 additions & 2 deletions tests/Sniffs/Extension/DisallowOwnerPropertySniffTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Silverstripe\Sniffs\Extension;

use Silverstripe\Sniffs\Extension\DisallowOwnerPropertySniff;
use SlevomatCodingStandard\Sniffs\TestCase;

class DisallowOwnerPropertySniffTest extends TestCase
Expand All @@ -12,7 +14,7 @@ public function testNoErrors(): void
[],
[],
[
'--standard=' . __DIR__ . '/../../../src/ruleset.xml'
'--standard=Silverstripe'
]
);
self::assertNoSniffErrorInFile($report);
Expand All @@ -25,7 +27,7 @@ public function testErrors(): void
[],
[],
[
'--standard=' . __DIR__ . '/../../../src/ruleset.xml'
'--standard=Silverstripe'
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use SilverStripe\ORM\DataExtension;
use SilverStripe\Fake\Extension;


class MyCoolExtension extends DataExtension
{
function doSomething()
Expand Down

0 comments on commit bf1ed9b

Please sign in to comment.