GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(pmd): move the PMD rulesets to config and add Code Analyzer by dschach · Pull Request #351 · dschach/salesforce-trigger-framework

Conversation

@dschach

@dschach dschach commented Oct 29, 2026

Copy link
Copy Markdown
Owner

This PR moves the PMD rulesets from pmd/ to config/pmd/ and replaces the old single ruleset with the DevSecOps reference rules, split across a stock file and a custom Apex file. A new config/pmd/ruleset.xml imports both, so PMD can run from the repository root with one ruleset. It also installs Salesforce Code Analyzer with a configuration file that selects the same rules, and it adds @throws tags to the TriggerHandler ApexDoc headers.

Changes

BEGIN_NESTED_COMMIT
chore(pmd): move the PMD rulesets under config/pmd
The stock and custom Apex rules now live in config/pmd/, with config/pmd/ruleset.xml importing both. The old pmd/ruleset.xml and the unused pmd/deployRules.xml are removed. The CI workflow, the PMD SARIF action's README, .vscode/settings.json, and .gitignore point to the new paths.
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
chore(code-analyzer): install Salesforce Code Analyzer config
This adds code-analyzer.yml, which selects the Recommended and Custom rules from PMD, CPD, SFGE, and regex. A codeanalyzer:setup script in package.json regenerates it, and .vscode/settings.json gets matching Code Analyzer settings.
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
docs(ApexDoc): add throws tags to TriggerHandler headers
Each method that rejects null or blank input gets a @throws tag beside its existing @exception tag, so the generated docs list the exception where readers look for it. This changes comments only, not code.
END_NESTED_COMMIT

Behavior notes

Anyone who runs PMD or the Apex PMD extension against pmd/ruleset.xml must switch to config/pmd/ruleset.xml, because the old path no longer exists. The reference rule set replaces the old one, so PMD results on the next run may differ from before.

Test plan

Run pmd check from the repository root with config/pmd/ruleset.xml and confirm that it loads both imported rule files. Open an Apex class in VS Code and confirm the PMD extension reads the new ruleset. Confirm that the CI workflow starts the PMD action with the new path and that its annotations appear on the PR. Run the Apex tests to confirm that the TriggerHandler change alters only comments.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dschach added 3 commits October 29, 2026 19:37
@dschach
chore(pmd): update and move PMD rules
3b1b8bd
@dschach
chore(Code Analyzer): install SFCA and configuration file
74a1fea
@dschach
docs(ApexDoc): add @throws tag to headers
9c065ed
@dschach dschach self-assigned this Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d3c42d2) to head (9c065ed).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #351   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          214       214           
=========================================
  Hits           214       214           
Flag Coverage Δ
Apex 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dschach
dschach merged commit 01b0bae into main Oct 29, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dschach
dschach deleted the chore/pmd-ruleset branch October 29, 2026 08:46
@github-actions github-actions Bot mentioned this pull request Oct 29, 2026
chore(main): release 1.4.0 #348
Merged
dschach pushed a commit that referenced this pull request Oct 29, 2026
@github-actions
chore(main): release 1.4.0 (#348)
0adece6
🤖 I have created a release *beep* *boop*
---


##
[1.4.0](v1.3.0...v1.4.0)
(2026-10-29)


### Features

* **ci:** Add a job summary report for Code Analyzer results
([437f453](437f453))
* **handler:** Add protected accessors and correct the ApexDoc
([#349](#349))
([d3c42d2](d3c42d2))
* **handler:** Add protected getTriggerEvent and getHandlerName
([d3c42d2](d3c42d2))


### Bug Fixes

* **handler:** Log a warning when the loop limit is exceeded
([d3c42d2](d3c42d2))
* **scripts:** Write highlight.js to doc-assets with portable sed
([032a7b9](032a7b9))


### Miscellaneous Chores

* **apexdox:** Correct 2 stale comments in the ApexDox config
([a15667e](a15667e))
* **code-analyzer:** Install Salesforce Code Analyzer config
([01b0bae](01b0bae))
* **code-analyzer:** Remove machine paths from the config on commit
([437f453](437f453))
* **codecov:** Drop the LWC flag that nothing uploads
([6bd4946](6bd4946))
* **git:** Ignore the Code Analyzer report folder
([437f453](437f453))
* **ignore:** Skip the husky hooks and the LWC config files
([7ec40cd](7ec40cd))
* **pmd:** Move the PMD rulesets to config and add Code Analyzer
([#351](#351))
([01b0bae](01b0bae))
* **pmd:** Move the PMD rulesets under config/pmd
([01b0bae](01b0bae))
* **prettier:** Adopt the shared x2od prettier config
([#359](#359))
([7ec40cd](7ec40cd))
* **prettier:** Correct the comment on the XML print width override
([7ec40cd](7ec40cd))
* **prettier:** Extend the shared x2od Prettier configuration
([7ec40cd](7ec40cd))
* **prettier:** Ignore only what Prettier should skip
([032a7b9](032a7b9))
* **project:** Clean up the tooling scripts, ignore files, and READMEs
([#353](#353))
([032a7b9](032a7b9))
* **project:** Remove template leftovers from the ignore files
([032a7b9](032a7b9))
* **release:** Drop the 2 pre-major release-please flags
([6bd4946](6bd4946))
* **vscode:** Recommend better-comments-next instead of better-comments
([d3c42d2](d3c42d2))


### Code Refactoring

* **ci:** Read Code Analyzer results from JSON, not SARIF
([437f453](437f453))
* **handler:** Simplify setBypass to 4 statements
([d3c42d2](d3c42d2))


### Styles

* **docs:** Reformat the documentation assets to the shared style
([7ec40cd](7ec40cd))
* **pmd:** Rewrap the PMD rulesets at 80 characters
([7ec40cd](7ec40cd))
* **prettier:** Reformat the config and scripts to the shared style
([7ec40cd](7ec40cd))


### Documentation

* **actions:** Show the Code Analyzer CLI in the action examples
([032a7b9](032a7b9))
* **ApexDoc:** Add throws tags to TriggerHandler headers
([01b0bae](01b0bae))
* **changelog:** Link the first release to its release page
([a15667e](a15667e))
* **contributing:** Add a contributing guide for this repository
([a15667e](a15667e))
* **deploy:** Correct the scratch org instructions
([a15667e](a15667e))
* **github:** Add a pull request template
([a15667e](a15667e))
* **github:** Add the code of conduct to this repository
([f1ff40b](f1ff40b))
* **github:** Replace the issue templates with framework issue forms
([a15667e](a15667e))
* **handler:** Correct the ApexDoc statements and examples
([d3c42d2](d3c42d2))
* **handler:** Say when andFinally does not run
([d3c42d2](d3c42d2))
* **license:** Keep the BSD text alone and credit the original in NOTICE
([a15667e](a15667e))
* **project:** Add community files and fix the license and deploy docs
([#355](#355))
([a15667e](a15667e))
* **readme:** Add an API reference and fix the documentation links
([032a7b9](032a7b9))
* **readme:** Correct the bypass, loop count, and handler examples
([032a7b9](032a7b9))
* **sample:** Move the sample README and describe the sample
([032a7b9](032a7b9))


### Build System

* **@x2od/prettier-config:** Update devDependency @x2od/prettier-config
from 0.6.1 to 0.7.0
([#360](#360))
([a4585f7](a4585f7))
* **node:** Update Node.js from v22.22.1 to v24.22.2
([#356](#356))
([f522648](f522648))
* **npm:** Call lint-staged from the hook and prune gone branches
([032a7b9](032a7b9))
* **npm:** Get the Prettier plugins through the shared x2od config
([7ec40cd](7ec40cd))
* **npm:** Remove the local Apex Prettier server scripts
([7ec40cd](7ec40cd))
* **npm:** Run the Prettier scripts on the whole tree
([032a7b9](032a7b9))


### Continuous Integration

* **actions/setup-java:** Update actions/setup-java action from v5 to v6
([#357](#357))
([34c1596](34c1596))
* **apex-tests:** Fetch 2 commits and give Codecov the pull request base
([d3c42d2](d3c42d2))
* **apex-tests:** Pass the Dev Hub secret through stdin
([6bd4946](6bd4946))
* **apex-tests:** Put the stdin flag last so the alias is kept
([6bd4946](6bd4946))
* **code-analyzer:** Report Code Analyzer results from JSON
([#352](#352))
([437f453](437f453))
* **codecov:** Troubleshoot Codecov base commit error
([#350](#350))
([d0f4621](d0f4621))
* **java-jdk:** Update dependency java-jdk from v21 to v25
([#358](#358))
([83abc66](83abc66))
* **workflows:** Give the workflow tokens read-only permissions
([6bd4946](6bd4946))
* **workflows:** Harden the CI workflows and run the checks for every
author
([#347](#347))
([6bd4946](6bd4946))
* **workflows:** Run the Code Analyzer CLI and write results to sfca
([437f453](437f453))
* **workflows:** Run the formatting and PMD checks for every author
([6bd4946](6bd4946))
* **workflows:** Split the Apex tests from CI and drop the residue
([6bd4946](6bd4946))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dschach dschach

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dschach
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.