From 5307137918976fab60d79a21cb65bd4dd2db0bdf Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 13 Feb 2025 07:47:13 -0700 Subject: [PATCH] Cursor rule cleanup --- .cursor/rules/adding-changelog.mdc | 2 +- .cursor/rules/code-style-structure.mdc | 4 ++-- .cursor/rules/development-guidelines.mdc | 2 +- .cursor/rules/js-testing.mdc | 5 ++--- .cursor/rules/php-standards.mdc | 4 ++-- .cursor/rules/php-testing.mdc | 6 +++--- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.cursor/rules/adding-changelog.mdc b/.cursor/rules/adding-changelog.mdc index 8f41276714a6b..64deff888d5ad 100644 --- a/.cursor/rules/adding-changelog.mdc +++ b/.cursor/rules/adding-changelog.mdc @@ -18,4 +18,4 @@ The “Significance” header specifies the significance of change in the style The “Type” header categorizes the change in the changelog. In Jetpack, for example, our changelog divides changes into “Major Enhancements”, “Enhancements”, “Improved compatibility”, and “Bugfixes”. Type must be "security", "added", "changed", "deprecated", "removed", or "fixed" -The body is separated from the headers by a blank line, and is the text that actually goes into the changelog. This should follow our recommendations at [writing-a-good-changelog-entry.md](mdc:jetpack/jetpack/jetpack/docs/writing-a-good-changelog-entry.md). +The body is separated from the headers by a blank line, and is the text that actually goes into the changelog. This should follow our recommendations at @docs/writing-a-good-changelog-entry.md. diff --git a/.cursor/rules/code-style-structure.mdc b/.cursor/rules/code-style-structure.mdc index 0d9352487ba89..4a53d4cd025cf 100644 --- a/.cursor/rules/code-style-structure.mdc +++ b/.cursor/rules/code-style-structure.mdc @@ -2,7 +2,7 @@ description: General guidelines on code style and structure globs: --- -General guidelines are defined in [coding-guidelines.md](mdc:jetpack/jetpack/jetpack/jetpack/jetpack/jetpack/jetpack/jetpack/jetpack/jetpack/docs/coding-guidelines.md). +General guidelines are defined in @docs/coding-guidelines.md. ### Naming Conventions @@ -10,4 +10,4 @@ General guidelines are defined in [coding-guidelines.md](mdc:jetpack/jetpack/jet - Prefix any global php functions or hooks with `jetpack_` - Use lowercase with underscores for PHP functions - Follow WordPress React component naming patterns -- Use BEM-like naming for SCSS \ No newline at end of file +- Use BEM-like naming for SCSS diff --git a/.cursor/rules/development-guidelines.mdc b/.cursor/rules/development-guidelines.mdc index 781d514d187e5..3a399075f312c 100644 --- a/.cursor/rules/development-guidelines.mdc +++ b/.cursor/rules/development-guidelines.mdc @@ -19,7 +19,7 @@ Before responding to any request, follow these steps: - Determine if task involves plugin core (PHP) or frontend (JS/React) - Identify WordPress hooks and filters needed -- Note compatibility requirements (WordPress version, PHP version), based on the different versions specified in [versions.sh](mdc:jetpack/jetpack/jetpack/jetpack/jetpack/.github/versions.sh) +- Note compatibility requirements (WordPress version, PHP version), based on the different versions specified in @.github/versions.sh - Define core functionality and user experience goals - Consider WordPress coding standards compliance diff --git a/.cursor/rules/js-testing.mdc b/.cursor/rules/js-testing.mdc index 1a61266825c85..db7a8b31263b5 100644 --- a/.cursor/rules/js-testing.mdc +++ b/.cursor/rules/js-testing.mdc @@ -8,7 +8,6 @@ globs: - Implement proper async testing - Use WordPress mocking patterns +Check @projects/packages/my-jetpack/_inc/components/connection-status-card/test/component.tsx for an example. -Check [component.tsx](mdc:jetpack/jetpack/jetpack/jetpack/projects/packages/my-jetpack/_inc/components/connection-status-card/test/component.tsx) for an example. - -Find out more about how to develop tests at [automated-testing.md](mdc:jetpack/jetpack/docs/automated-testing.md) \ No newline at end of file +Find out more about how to develop tests at @docs/automated-testing.md diff --git a/.cursor/rules/php-standards.mdc b/.cursor/rules/php-standards.mdc index 971b3faf892b9..6d4e220544844 100644 --- a/.cursor/rules/php-standards.mdc +++ b/.cursor/rules/php-standards.mdc @@ -2,7 +2,7 @@ description: PHP coding standards globs: *.php --- -- Follow WordPress PHP Coding Standards +- Follow WordPress PHP Coding Standards, superseded by @projects/packages/codesniffer/Jetpack/ruleset.xml - Use proper WordPress prefix for functions and classes - Implement WordPress nonce verification - Follow WordPress database operations best practices @@ -17,4 +17,4 @@ When needing to add a package version number inside a DocBlock, please use `$$ne - `@deprecated since $$next-version$$` - `_deprecated_function( __METHOD__, 'package-$$next-version$$' );` (other WordPress deprecation functions also work, but note it must be all on one line). -The `$$next-version$$` specifier will be automatically replaced with the correct package version number the next time a new version of that package is released. \ No newline at end of file +The `$$next-version$$` specifier will be automatically replaced with the correct package version number the next time a new version of that package is released. diff --git a/.cursor/rules/php-testing.mdc b/.cursor/rules/php-testing.mdc index dd1bcfb8da893..472f1d93f228f 100644 --- a/.cursor/rules/php-testing.mdc +++ b/.cursor/rules/php-testing.mdc @@ -4,11 +4,11 @@ globs: --- When developing Unit Tests in PHP, follow these guidelines: -- Use PHPUnit with WordPress test framework +- Use PHPUnit, with @automattic/wordbless, @brain/monkey, or the WordPress testing framework as needed - Follow WordPress testing conventions - Use WordPress fixtures and mocks - Test WordPress hooks and filters -Check [test_Manager_integration.php](mdc:jetpack/jetpack/jetpack/jetpack/projects/packages/connection/tests/php/test_Manager_integration.php) for an example. +Check @projects/packages/connection/tests/php/test_Manager_integration.php for an example. -Find out more rules on how to write tests at [automated-testing.md](mdc:jetpack/jetpack/docs/automated-testing.md) \ No newline at end of file +Find out more rules on how to write tests at @docs/automated-testing.md