You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to modifiy with "spotlessApply" only current PR *.java files on GitHubEnterprise?
#3154
This replaces/enforces the rules in all files in project/repo, not only my changes in current PR.
#!/bin/bash
# 1. Fetch the exact files changed in the PR as a clean list
FILES=$(gh pr diff --name-only)
# 2. Escape special characters like '.' and wrap each file in a strict absolute path match
REGEX_LIST=$(echo "$FILES" | sed 's/\./\\./g' | sed 's/^/.*/' | tr '\n' ',' | sed 's/,$//')
# 3. Execute Spotless with the strict boundaries
gradle spotlessApply -PspotlessFiles="$REGEX_LIST"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
This replaces/enforces the rules in all files in project/repo, not only my changes in current PR.
All reactions