diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f4a4056..c4a3535 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,17 +4,17 @@ updates: directory: '/' schedule: interval: 'weekly' - cooldown: - semver-major-days: 30 - semver-minor-days: 7 - semver-patch-days: 7 groups: - composer-minor-patch: - update-types: [minor, patch] + production-dependencies: + dependency-type: 'production' + development-dependencies: + dependency-type: 'development' + commit-message: + prefix: 'fix(deps)' + - package-ecosystem: 'github-actions' directory: '/' schedule: interval: 'weekly' - groups: - github-actions-updates: - patterns: ['*'] + commit-message: + prefix: 'chore(deps)' diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..af3b172 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 #v4.4.0 + with: + # Use manifest-based release + manifest-file: .release-please-manifest.json + config-file: release-please-config.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3b73e6..c880a02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,8 +37,8 @@ jobs: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false + show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} + persist-credentials: false - name: Setup PHP uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4 @@ -65,5 +65,5 @@ jobs: - name: Validate the WordPress rulesets uses: phpcsstandards/xmllint-validate@0fd9c4a9046055f621fca4bbdccb8eab1fd59fdc # v1.0.1 with: - pattern: "./*/ruleset.xml" - xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd" + pattern: './*/ruleset.xml' + xsd-file: 'vendor/squizlabs/php_codesniffer/phpcs.xsd' diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..f2ecd08 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/LICENSE.md b/LICENSE.md index 51ae63a..5db7082 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,7 +2,7 @@ Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. + Copyright (C) 1989, 1991 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -96,17 +96,14 @@ portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - **a)** You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. - **b)** You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. - **c)** If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement @@ -143,12 +140,10 @@ the scope of this License. under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - **a)** Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - **b)** Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable @@ -156,7 +151,6 @@ copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - **c)** Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the @@ -330,7 +324,7 @@ when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome - to redistribute it under certain conditions; type `show c' + to redistribute it under certain conditions; type `show c' for details. The hypothetical commands \`show w' and \`show c' should show the @@ -345,7 +339,7 @@ if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' - (which makes passes at compilers) written + (which makes passes at compilers) written by James Hacker. signature of Moe Ghoul, 1 April 1989 diff --git a/README.md b/README.md index f57f079..8ea62f9 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Consistent coding standards reduce bugs, prevent common mistakes, and lower tech - [`rtCamp`](rtCamp/ruleset.xml): the full superset with all of the sniffs in the project. - 🎯 **Use this by default** and customize as needed, unless you have a particular reason to use or compose the others. + 🎯 **Use this by default** and customize as needed, unless you have a particular reason to use or compose the others. - [`rtCamp-Minimum`](./rtCamp-Minimum/ruleset.xml): Essential sniffs for enterprise-ready code. All rtCamp code should pass this. @@ -45,7 +45,7 @@ Consistent coding standards reduce bugs, prevent common mistakes, and lower tech - [`rtCamp-Extra`](./rtCamp-Extra/ruleset.xml): `rtCamp-Basic` plus additional quality-focused sniffs for internal projects that prioritize higher standards without `rtCamp-Strict`'s rigidity. -- [`rtCamp-Strict`](./rtCamp-Strict/ruleset.xml): `rtCamp-Basic` plus stricter functional sniffs for maximum quality and maintainability. This is recommended for public plugins and themes, or any project where you want to ensure the highest standards of code quality. +- [`rtCamp-Strict`](./rtCamp-Strict/ruleset.xml): `rtCamp-Basic` plus stricter functional sniffs for maximum quality and maintainability. This is recommended for public plugins and themes, or any project where you want to ensure the highest standards of code quality. - [`rtCamp-Docs`](./rtCamp-Docs/ruleset.xml): Doc-block and comment sniffs to ensure clear, well-documented code. This is recommended for any project where you want to ensure that your code is well-documented and easy to understand - by developers and AI agents alike. @@ -101,6 +101,19 @@ Because code quality tooling can make "breaking" ambiguous, we follow [Eslint's Minor releases may increase reported linting errors. For projects without a lockfile, pin the dependency with a tilde(`~`) in `composer.json` to receive patch updates only, e.g. "rtcamp/coding-standards-d": "~1.1.0". +### Automated Releases + +This project uses [release-please](https://github.com/googleapis/release-please) to automate versioning and releases. To trigger a release, use [Conventional Commits](https://www.conventionalcommits.org/): + +- `feat:` for **MINOR** releases (new rules, behavior changes). +- `fix:` for **PATCH** releases (bug fixes, dependency updates). +- Commits with `!` or `BREAKING CHANGE:` in the footer for **MAJOR** releases. + +Releases are automatically managed via a "Release PR". Merging this PR will tag the release, create a GitHub Release, and update the `CHANGELOG.md`. + +> [!TIP] +> Dependabot is configured to use the `fix(deps):` prefix for all updates to ensure production dependency changes trigger a release. For development-only updates, you can manually change the PR title to `chore(deps):` before merging if a version bump is not desired. + > [!IMPORTANT] > These guidelines apply to most PHPCS ruleset libraries, including those we use in this project. > diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..2342e5d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,8 @@ +{ + "packages": { + ".": { + "release-type": "php", + "bump-minor-pre-major": true + } + } +}