Add useProjectSettings option to CleanUpMojo
Adds a useProjectSettings parameter to CleanUpMojo to read cleanup preferences from Eclipse project settings, matching the behavior already present in the compiler mojo.
Changes
CleanUpMojo.java
- Added
useProjectSettingsparameter (default:true) - Implemented
loadCleanupSettingsFromPrefsFile()to parse.settings/org.eclipse.jdt.ui.prefsand extract keys withcleanup.orsp_cleanup.prefixes - Implemented
getEffectiveCleanUpProfile()to merge mojo configuration with project settings (project settings take precedence) - Returns
nullwhen no settings configured, consistent with existingCleanUpclass behavior
tycho-core/.gitignore
- Added
http/andhttps/to exclude build cache artifacts
Usage
When enabled (default), cleanup settings from .settings/org.eclipse.jdt.ui.prefs override the cleanUpProfile parameter:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-cleancode-plugin</artifactId>
<configuration>
<!-- Uses project settings by default -->
<useProjectSettings>true</useProjectSettings>
<!-- These values will be overridden by project settings if present -->
<cleanUpProfile>
<sp_cleanup.format_source_code>true</sp_cleanup.format_source_code>
</cleanUpProfile>
</configuration>
</plugin>
Gracefully handles missing preference files with debug logging.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
testng.org
- Triggering command:
/opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/tycho/.codeql-scratch/dbs/java/working/files-to-index15590033309118846739.list --sourceArchiveDir=/home/REDACTED/work/tycho/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/tycho/.codeql-scratch/dbs/java/trap/java(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
Original prompt
Add an option "useProjectSettings" to the CleanUpMojo
In the compiler mojo we already have a setting "use project settings" to allow tycho to use the preferences from the IDE.
We need such option here as well and if enabled a project setting found will override the mojo configured map (we need to üarse the preference file and extract all keys starting with cleanup. as we can not pass the file directly to the code)
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
I just realized there are two ways, need to first clarify what should be supported:
- https://github.com/eclipse-jdt/eclipse.jdt.core/discussions/4582
we then also need to adjust the previous feature
- https://github.com/eclipse-tycho/tycho/pull/5557
as it currently only updates the cleanup profile