Skip to content

Separate shared PMD configuration from toolchain selection - #106

Merged
Bencodes merged 4 commits into
masterfrom
move-shared-pmd-policy-into-toolchain-profiles
Nov 8, 2026
Merged

Bencodes merged 4 commits into
masterfrom
move-shared-pmd-policy-into-toolchain-profiles

Conversation

@Bencodes

@Bencodes Bencodes commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

pmd_config lets pmd and pmd_test share analysis settings without registering a separate toolchain. Bazel still selects the executable.

Migration: Move rulesets, rules_minimum_priority, and threads_count into a pmd_config target. Reference it with config = ":policy", or set the toolchain's default_config for repository-wide use. An explicit config replaces the default; settings do not merge. fail_on_violation stays on each target. Use Bazel's --host_jvmopt instead of the toolchain's jvm_flags.

docs/*.md were updated by hand because stardoc does not build locally; regenerate with docs/generate.sh before merging.

@Bencodes
Bencodes force-pushed the move-shared-pmd-policy-into-toolchain-profiles branch 2 times, most recently from b0b5e8b to b079a90 Compare September 13, 2026 19:07
@Bencodes Bencodes changed the title Move shared PMD policy into toolchain profiles Separate shared PMD configuration from toolchain selection Sep 13, 2026
Configure rulesets, priority, violation policy, concurrency, JVM flags and the exec wrapper in selected or registered profiles. Keep source metadata and report outputs on native PMD rules, migrate fixtures and documentation, and cover profile selection and isolation with declarative Bazel tests.
@Bencodes
Bencodes force-pushed the move-shared-pmd-policy-into-toolchain-profiles branch from cb56954 to 299c0b6 Compare November 8, 2026 02:59
Replace the toolchain's default_config with the @rules_pmd//pmd:config
label flag so only the root module can set the repository-wide default.
Move fail_on_violation back to pmd/pmd_test as a per-target choice.

Validate PmdConfigInfo fields and restrict rules_minimum_priority to 1-5.
Name the selected config in the empty-rulesets error.

Tests assert flag/value pairs, cover both select() branches, decode
Bazel 8 middleman names fully, and drop assertions that could not fail.
README documents cross-package configs, the label flag, and
--host_jvmopt for JVM options.
Targets without config fall back to the registered toolchain's
default_config again. The empty-rulesets error names that config's label.
@Bencodes
Bencodes merged commit 9d204c6 into master Nov 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant