refactor: Cleanup git state - commit all staged changes
Major refactoring cleanup: - Add new controller architecture (class-controller-*.php) - Add new settings-v2 UI (views/settings-v2/) - Add new CSS architecture (agentic-sidebar.css, tokens) - Add esbuild build pipeline (scripts/build.js, package.json) - Add composer dependencies (vendor/) - Add frontend src directory (assets/js/src/index.jsx) - Add documentation files - Remove old/obsolete files (class-settings.php, old CSS) This commits all pending changes from previous refactoring efforts.
This commit is contained in:
18
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc
vendored
Normal file
18
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class containing no style errors according to the end-to-end tests phpcs.xml.dist.
|
||||
*
|
||||
* @copyright 2025 PHPCSStandards and contributors
|
||||
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
|
||||
*/
|
||||
|
||||
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
|
||||
|
||||
class ClassOneWithoutStyleError
|
||||
{
|
||||
private function foo()
|
||||
{
|
||||
return 'bar';
|
||||
}
|
||||
}
|
||||
20
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc
vendored
Normal file
20
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class containing no style errors.
|
||||
*
|
||||
* @copyright 2025 PHPCSStandards and contributors
|
||||
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
|
||||
*/
|
||||
|
||||
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
|
||||
|
||||
class ClassTwoWithoutStyleError
|
||||
{
|
||||
/**
|
||||
* A property.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $bar = 'baz';
|
||||
}
|
||||
22
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/ClassWithStyleError.inc
vendored
Normal file
22
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/ClassWithStyleError.inc
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class containing a simple style error that phpcbf can fix.
|
||||
*
|
||||
* @copyright 2025 PHPCSStandards and contributors
|
||||
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/HEAD/licence.txt BSD Licence
|
||||
*/
|
||||
|
||||
namespace PHP_CodeSniffer\Tests\EndToEnd\Fixtures;
|
||||
|
||||
class ClassWithStyleError
|
||||
{
|
||||
/**
|
||||
* The bracket for this function is misaligned and this can be automatically fixed by phpcbf.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function foo() {
|
||||
return 'bar';
|
||||
}
|
||||
}
|
||||
13
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/endtoend.xml.dist
vendored
Normal file
13
vendor/squizlabs/php_codesniffer/tests/EndToEnd/Fixtures/endtoend.xml.dist
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="EndToEndTests" xsi:noNamespaceSchemaLocation="phpcs.xsd">
|
||||
<description>The coding standard for end to end tests.</description>
|
||||
|
||||
<rule ref="PSR12"/>
|
||||
|
||||
<file>.</file>
|
||||
|
||||
<arg name="basepath" value="."/>
|
||||
<arg name="colors"/>
|
||||
<arg name="parallel" value="75"/>
|
||||
<arg value="p"/>
|
||||
</ruleset>
|
||||
25
vendor/squizlabs/php_codesniffer/tests/EndToEnd/outofmemory_test.sh
vendored
Normal file
25
vendor/squizlabs/php_codesniffer/tests/EndToEnd/outofmemory_test.sh
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function tear_down() {
|
||||
rm -f tests/EndToEnd/Fixtures/*.fixed
|
||||
}
|
||||
|
||||
function test_phpcs_out_of_memory_error_handling() {
|
||||
OUTPUT="$(bin/phpcs -d memory_limit=4M --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/)"
|
||||
# Exit code may be 255 or 139 depending on the PHP version, but the exact code is not our concern, just that it's non-zero.
|
||||
assert_unsuccessful_code
|
||||
|
||||
assert_contains "The PHP_CodeSniffer \"phpcs\" command ran out of memory." "$OUTPUT"
|
||||
assert_contains "Either raise the \"memory_limit\" of PHP in the php.ini file or raise the memory limit at runtime" "$OUTPUT"
|
||||
assert_contains "using \"phpcs -d memory_limit=512M\" (replace 512M with the desired memory limit)." "$OUTPUT"
|
||||
}
|
||||
|
||||
function test_phpcbf_out_of_memory_error_handling() {
|
||||
OUTPUT="$(bin/phpcbf -d memory_limit=4M --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ --suffix=.fixed)"
|
||||
# Exit code may be 255 or 139 depending on the PHP version, but the exact code is not our concern, just that it's non-zero.
|
||||
assert_unsuccessful_code
|
||||
|
||||
assert_contains "The PHP_CodeSniffer \"phpcbf\" command ran out of memory." "$OUTPUT"
|
||||
assert_contains "Either raise the \"memory_limit\" of PHP in the php.ini file or raise the memory limit at runtime" "$OUTPUT"
|
||||
assert_contains "using \"phpcbf -d memory_limit=512M\" (replace 512M with the desired memory limit)." "$OUTPUT"
|
||||
}
|
||||
38
vendor/squizlabs/php_codesniffer/tests/EndToEnd/phpcbf_test.sh
vendored
Normal file
38
vendor/squizlabs/php_codesniffer/tests/EndToEnd/phpcbf_test.sh
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function tear_down() {
|
||||
rm -rf tests/EndToEnd/Fixtures/*.fixed
|
||||
}
|
||||
|
||||
function test_phpcbf_is_working() {
|
||||
OUTPUT="$(bin/phpcbf --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
|
||||
|
||||
assert_successful_code
|
||||
assert_contains "No violations were found" "$OUTPUT"
|
||||
}
|
||||
|
||||
function test_phpcbf_is_working_in_parallel() {
|
||||
OUTPUT="$(bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
|
||||
|
||||
assert_successful_code
|
||||
assert_contains "No violations were found" "$OUTPUT"
|
||||
}
|
||||
|
||||
function test_phpcbf_returns_error_on_issues() {
|
||||
OUTPUT="$(bin/phpcbf --no-colors --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
|
||||
assert_exit_code 1
|
||||
|
||||
assert_contains "F 1 / 1 (100%)" "$OUTPUT"
|
||||
assert_contains "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" "$OUTPUT"
|
||||
}
|
||||
|
||||
function test_phpcbf_bug_1112() {
|
||||
# See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
# Perform some magic with `& fg` to prevent the processes from turning into a background job.
|
||||
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc" & fg')"
|
||||
else
|
||||
# This is not needed on Linux / GitHub Actions
|
||||
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcbf --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc"')"
|
||||
fi
|
||||
}
|
||||
28
vendor/squizlabs/php_codesniffer/tests/EndToEnd/phpcs_test.sh
vendored
Normal file
28
vendor/squizlabs/php_codesniffer/tests/EndToEnd/phpcs_test.sh
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function test_phpcs_is_working() {
|
||||
assert_successful_code "$(bin/phpcs --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
|
||||
}
|
||||
|
||||
function test_phpcs_is_working_in_parallel() {
|
||||
assert_successful_code "$(bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc)"
|
||||
}
|
||||
|
||||
function test_phpcs_returns_error_on_issues() {
|
||||
OUTPUT="$(bin/phpcs --no-colors --no-cache --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc)"
|
||||
assert_exit_code 2
|
||||
|
||||
assert_contains "E 1 / 1 (100%)" "$OUTPUT"
|
||||
assert_contains "FOUND 1 ERROR AFFECTING 1 LINE" "$OUTPUT"
|
||||
}
|
||||
|
||||
function test_phpcs_bug_1112() {
|
||||
# See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
# Perform some magic with `& fg` to prevent the processes from turning into a background job.
|
||||
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc" & fg')"
|
||||
else
|
||||
# This is not needed on Linux / GitHub Actions
|
||||
assert_successful_code "$(bash -ic 'bash --init-file <(echo "echo \"Subprocess\"") -c "bin/phpcs --no-cache --parallel=2 --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassOneWithoutStyleError.inc tests/EndToEnd/Fixtures/ClassTwoWithoutStyleError.inc"')"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user