Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot easily delete / fix an incorrect link to a checkstyle.xml file #700

Open
leerho opened this issue May 14, 2024 · 1 comment
Open

Comments

@leerho
Copy link

leerho commented May 14, 2024

Configuration

Using Eclipse IDE for Java 2024-03 (4.31.0) Build id: 20240307-1437

  • A brand new installation in a brand new workspace
  • I only installed the Checkstyle plugin: 10.14.2.202403262245 net.sf.eclipsecs.feature.group
  • Imported only one existing java/maven root project with 2 sub-projects

Running on Apple MacBook Pro, Apple M1 Pro chip, macOS Sonoma 14.4.1

Description / Steps to Reproduce

I accidentally inserted an incorrect location for a checkstyle.xml file, which I discovered later.
But it is incredibly difficult to fix it.

Steps to Reproduce:

  • First insert an invalid path to a custom checkstyle.xml file in Local Check Configurations, Apply and close.
  • Right-click on project, select Properties / Checkstyle
    • The "Location" box at the top has a red X (of course) with the incorrect location listed
  • Select "Local Check Configurations"
  • Select the bad "Check Configuration" / Remove
  • First I get a Confirm Delete pop-up, click "Yes"
  • Then I get this error message:

The Check Configuration "<file name>" is currently in use by a project.
It must be removed from all project configurations before it can be deleted.

I tried deactivating checkstyle in the two projects (the only two).
I also unclicked the box "Checkstyle active for each project".
None of this allowed me to simply correct the path to the xml file. I didn't know what else to do to remove Checkstyle from being used.

Finally, after trying all kinds of things I tried this:

  • In Local Check Configurations I added a new correct entry with a different name.
  • Then returned to the "Main" menu and selected it instead of the bad one.
  • IN the "Main" menu, I Hit "Apply and Close" - This closed me all the way out.
    • Note: If there was an "Apply" button it would allow me to easily return to the Local Config dialog.
  • Then I re-entered into Checkstyle / Local Check Configurations
  • Now I could delete the incorrect entry.

Yes, I did finally figure out how to fix it. So what is the problem?

  1. It is inordinately complicated to simply fix an incorrect path!

  2. The error message words: "The Check Configuration "<file name>" is currently in use by a project" led me down a rat-hole trying to "deactivate" its use at the project level.

  3. The error message words "It must be removed from all project configurations before it can be deleted." also led me to look at where at the project level I activated checkstyle.

  4. What I would suggest is when the checkstyle code figures out that the path is incorrect display an error message something like this:

The current configuration file <blah> cannot be found. Correct this by choosing and applying any valid configuration (e.g, default) from the Main dialog
and then return to the Local Check Configuration menu to delete the incorrect one,
and then create a new Check Configuration.

Even better: find an even easier way to fix a broken or invalid path to the xml file!

@leerho
Copy link
Author

leerho commented May 14, 2024

It was closed in eclipse-packaging/packages because this issue belongs here.

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

No branches or pull requests

1 participant