Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooling: Cursor rule cleanup #41786

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor/rules/adding-changelog.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't seem to work for me. Cursor seems to want that markdown link with that special mdc: format. It doesn't recognize the link otherwise.

I'm not sure where that mulitple jetpack comes from though ; when I create the link today I only get one jetpack.

4 changes: 2 additions & 2 deletions .cursor/rules/code-style-structure.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
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

- Use WordPress naming conventions for functions and classes
- 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
- Use BEM-like naming for SCSS
2 changes: 1 addition & 1 deletion .cursor/rules/development-guidelines.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions .cursor/rules/js-testing.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Find out more about how to develop tests at @docs/automated-testing.md
4 changes: 2 additions & 2 deletions .cursor/rules/php-standards.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
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.
6 changes: 3 additions & 3 deletions .cursor/rules/php-testing.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Find out more rules on how to write tests at @docs/automated-testing.md
Loading