jshiell / checkstyle-idea

CheckStyle plug-in for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Other
889 stars 161 forks source link

CheckStyle-IDEA 5.94.1: Error when applying checkstyle file to Code Style #651

Closed zhangbutao closed 1 month ago

zhangbutao commented 2 months ago

latest IntelliJ IDEA 2024.2.1 + CheckStyle-IDEA 5.94.1

I can add the checkstyle file into checkstyle plugin: idea2024-hive-ice-check

But Error will encounter when i apply the checkstyle file to Code Style: codestyle-error And the Idea error log shows that Property ${config_loc} has not been set in my checkstyle file.

2024-09-10 03:02:57,145 [14542363]   WARN - #org.infernus.idea.checkstyle.importer.CheckStyleCodeStyleImporter - Failed to import style
org.infernus.idea.checkstyle.exception.CheckstyleToolException: unable to parse configuration stream
        at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:130)
        at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.loadConfiguration(CheckstyleActionsImpl.java:97)
        at org.infernus.idea.checkstyle.importer.CheckStyleCodeStyleImporter.loadConfiguration(CheckStyleCodeStyleImporter.java:82)
        at org.infernus.idea.checkstyle.importer.CheckStyleCodeStyleImporter.importScheme(CheckStyleCodeStyleImporter.java:51)
        at org.infernus.idea.checkstyle.importer.CheckStyleCodeStyleImporter.importScheme(CheckStyleCodeStyleImporter.java:21)
        at com.intellij.application.options.codeStyle.CodeStyleSchemesActions.importExternalCodeStyle(CodeStyleSchemesActions.java:117)
        at com.intellij.application.options.codeStyle.CodeStyleSchemesActions.chooseAndImport(CodeStyleSchemesActions.java:87)
        at com.intellij.application.options.codeStyle.CodeStyleSchemesActions.importScheme(CodeStyleSchemesActions.java:50)
        at com.intellij.application.options.schemes.AbstractSchemeActions$ImportAction.actionPerformed(AbstractSchemeActions.java:359)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:345)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks$lambda$4(ActionUtil.kt:316)
        at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1173)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.kt:315)
        at com.intellij.ui.popup.ActionPopupStep.performActionItem(ActionPopupStep.java:294)
        at com.intellij.ui.popup.ActionPopupStep.lambda$onChosen$3(ActionPopupStep.java:260)
        at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1793)
        at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
        at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
        at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
        at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
        at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.lambda$doWhenFocusSettlesDown$4(FocusManagerImpl.java:178)
        at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:33)
        at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.kt:1281)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:173)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:165)
        at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1791)
        at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:178)
        at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:406)
        at com.intellij.ui.popup.PopupFactoryImpl$ActionGroupPopup.dispose(PopupFactoryImpl.java:308)
        at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:131)
        at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:163)
        at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205)
        at com.intellij.openapi.util.Disposer.dispose(Disposer.java:193)
        at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:286)
        at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:288)
        at com.intellij.ui.popup.list.ListPopupImpl.disposePopup(ListPopupImpl.java:532)
        at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:556)
        at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:517)
        at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:448)
        at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:774)
        at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6662)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3394)
        at com.intellij.ui.popup.list.ListPopupImpl$MyList.processMouseEvent(ListPopupImpl.java:839)
        at java.desktop/java.awt.Component.processEvent(Component.java:6427)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5032)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4860)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4963)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4577)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4518)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2810)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4860)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:783)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:755)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:753)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:752)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:696)
        at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:635)
        at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$14(IdeEventQueue.kt:581)
        at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:581)
        at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
        at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
        at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
        at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
        at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
        at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
        at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
        at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
        at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
        at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
        at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
        at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
        at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
        at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
        at java.desktop/java.awt.Dialog.show(Dialog.java:1079)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:887)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:469)
        at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1763)
        at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1712)
        at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.kt:97)
        at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:61)
        at com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:48)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:345)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks$lambda$4(ActionUtil.kt:316)
        at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1173)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.kt:315)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction$lambda$5(ActionMenuItem.kt:273)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:231)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.kt:264)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem._init_$lambda$0(ActionMenuItem.kt:71)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed$lambda$4(ActionMenuItem.kt:102)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
        at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
        at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.kt:101)
        at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:518)
        at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:551)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6662)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3394)
        at java.desktop/java.awt.Component.processEvent(Component.java:6427)
        at java.desktop/java.awt.Container.processEvent(Container.java:2266)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5032)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4860)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4963)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4577)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4518)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2810)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4860)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:783)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:755)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:753)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:752)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:696)
        at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:635)
        at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$14(IdeEventQueue.kt:581)
        at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:581)
        at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
        at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
        at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
        at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
        at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
        at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
        at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
        at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
        at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
        at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
        at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
        at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
        at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
        at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: unable to parse configuration stream
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:320)
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:282)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at org.infernus.idea.checkstyle.service.cmd.OpLoadConfiguration.loadConfigurationForCheckstyle825AndAbove(OpLoadConfiguration.java:180)
        at org.infernus.idea.checkstyle.service.cmd.OpLoadConfiguration.callLoadConfiguration(OpLoadConfiguration.java:148)
        at org.infernus.idea.checkstyle.service.cmd.OpLoadConfiguration.execute(OpLoadConfiguration.java:131)
        at org.infernus.idea.checkstyle.service.cmd.OpLoadConfiguration.execute(OpLoadConfiguration.java:44)
        at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:116)
        ... 175 more
Caused by: org.xml.sax.SAXException: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${config_loc} has not been set
com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${config_loc} has not been set
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader$InternalLoader.startElement(ConfigurationLoader.java:532)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:752)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1387)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
        at com.puppycrawl.tools.checkstyle.XmlLoader.parseInputSource(XmlLoader.java:84)
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader.parseInputSource(ConfigurationLoader.java:195)
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:311)
        ... 183 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${config_loc} has not been set
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader.replaceProperties(ConfigurationLoader.java:367)
        at com.puppycrawl.tools.checkstyle.ConfigurationLoader$InternalLoader.startElement(ConfigurationLoader.java:526

But i can not set Property ${config_loc} when importing checkstyle configuration in the Code Style operation. @jshiell Could you guide me how to fix this issue? BTW, The low version CheckStyle-IDEA-5.86.0 & CheckStyle-IDEA-5.92.0 can apply checkstyle file into Code Style sucessufully. Do you think this issue be related this change https://github.com/jshiell/checkstyle-idea/commit/b62c2f056b21aea1f059947115478f331b71943d?

Here is my checkstyle file: checkstyle.txt

Thanks in advance!

jshiell commented 2 months ago

Hi - I fear I can't reproduce this. When I add your config file and click next, it correctly shows the config_loc property. As long as I set it it works correctly.

Are you not seeing this panel, or is it empty, or something else?

image
zhangbutao commented 2 months ago

@jshiell Hi, I mean that the Code Style is not ok. You can try to import the checkstyle file in Code Style tool. It will encounter error. idea2024-import-checkstyle_1

jshiell commented 2 months ago

Oh, sorry - thanks for clarifying. I'll try have a look this weekend.

Semihal commented 2 months ago

don't work on 5.94.0 and work on 5.93.4

jshiell commented 2 months ago

I'm pretty sure I know why this is occurring. Previously, we would just stub out the properties when doing this and return an empty string for each. Unfortunately this broke other configs that expected enums (e.g. severity) or used default properties, in particular the latest bundled google_checks rules (which is why we had to fix it for Checkstyle 10.18 support).

I have a couple ideas of how to fix it - e.g. returning empty strings for properties that are value of a value, or removing elements that rely on properties before parsing the file - but they're all going to be a bit involved. As such, it's pretty unlikely to get fixed this week due to other commitments (primarily work travel).

In the meantime, you should be able to (clumsily) work-around it by removing the properties temporarily for import.

zhangbutao commented 2 months ago

No worry. I am using a low version CheckStyle-IDEA-5.92.0 now. It works well. @jshiell Thanks for your good plugin!!!

jshiell commented 2 months ago

I've got a potential fix - you can find the patched version here if you're willing to test it 🙏

The testing is pretty cursory and there's no way I'm going to release it just before being AFK for a week. Will try and get it tested & released next weekend, all being well.

zhangbutao commented 1 month ago

Thanks for the fix! Will test the patched version in one or two days.

zhangbutao commented 1 month ago

I've got a potential fix - you can find the patched version here if you're willing to test it 🙏

The testing is pretty cursory and there's no way I'm going to release it just before being AFK for a week. Will try and get it tested & released next weekend, all being well.

I tested the patched version against Intellij2024.2.1. The Code Style & CheckStyle tools are both work fine. So I think the fix is good. Thanks very much!!!

jshiell commented 1 month ago

Thank you for your report and your help in fixing this - it's always greatly appreciated! I'll get this released now.