Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

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 useProjectSettings parameter (default: true)
  • Implemented loadCleanupSettingsFromPrefsFile() to parse .settings/org.eclipse.jdt.ui.prefs and extract keys with cleanup. or sp_cleanup. prefixes
  • Implemented getEffectiveCleanUpProfile() to merge mojo configuration with project settings (project settings take precedence)
  • Returns null when no settings configured, consistent with existing CleanUp class behavior

tycho-core/.gitignore

  • Added http/ and https/ 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:

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.

Copilot AI and others added 4 commits November 1, 2025 06:41
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Co-authored-by: laeubi <1331477+laeubi@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option 'useProjectSettings' to CleanUpMojo Add useProjectSettings option to CleanUpMojo Nov 1, 2025
Copilot AI requested a review from laeubi November 1, 2025 06:55
@laeubi
Copy link
Member

laeubi commented Nov 1, 2025

I just realized there are two ways, need to first clarify what should be supported:

we then also need to adjust the previous feature

as it currently only updates the cleanup profile

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.

2 participants