Skip to content

Commit f6128f3

Browse files
committed
Remove MoodleManagerListener and register bundled inspection profile in plugin.xml. Add "Moodle" inspection profile configuration file.
1 parent 67df32a commit f6128f3

4 files changed

Lines changed: 54 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Bundled Moodle inspection profile and registered it in plugin.xml so it becomes available after plugin installation
13+
- Automatically set the bundled "Moodle" inspection profile as the Project profile on first project open so it appears in Settings | Editor | Inspections and is selected in the Project profiles dropdown (non-intrusive: won’t override an existing custom selection)
14+
- On project open, construct InspectionProfileImpl from bundled resources/inspectionProfiles/Moodle.xml and set it as the project profile via ProjectInspectionProfileManager#setCurrentProfile
15+
1016
### Fixed
1117

18+
- Corrected automatic selection of the bundled "Moodle" inspection profile as the Project profile on project open so it reliably appears in Settings | Editor | Inspections profiles dropdown
1219
- Replaced deprecated ProcessAdapter with ProcessListener in ComposerUtil.kt to maintain compatibility with latest IntelliJ Platform SDK
1320
- Removed usage of unstable UI DSL builder textFieldWithBrowseButton in MoodleSettingsForm by using Swing TextFieldWithBrowseButton within cell(...); satisfies UnstableApiUsage inspection
1421

src/main/kotlin/il/co/sysbind/intellij/moodledev/listeners/MoodleManagerListener.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
implementation="il.co.sysbind.intellij.moodledev.codeStyle.MoodleJavascriptPredefinedCodeStyle"/>
3939
<predefinedCodeStyle implementation="il.co.sysbind.intellij.moodledev.codeStyle.MoodleLessPredefinedCodeStyle"/>
4040
<predefinedCodeStyle implementation="il.co.sysbind.intellij.moodledev.codeStyle.MoodleScssPredefinedCodeStyle"/>
41+
<bundledInspectionProfile path="/inspectionProfiles/Moodle" id="Moodle.InspecProfile"/>
4142

4243
<internalFileTemplate name="Moodle PHP File"/>
4344
<internalFileTemplate name="Moodle PHP Class"/>
@@ -56,10 +57,6 @@
5657
<frameworkUsageProvider implementation="il.co.sysbind.intellij.moodledev.project.MoodleUsageProvider"/>
5758
<libraryRoot id="phpstorm.meta.php" path="/moodle-dev/" runtime="false"/>
5859
</extensions>
59-
<projectListeners>
60-
<listener class="il.co.sysbind.intellij.moodledev.listeners.MoodleManagerListener"
61-
topic="com.intellij.openapi.startup.StartupActivity"/>
62-
</projectListeners>
6360

6461
<actions>
6562
<group id="Moodle.NewFile" text="Moodle Files">
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<component name="InspectionProjectProfileManager">
2+
<profile version="1.0">
3+
<option name="myName" value="Moodle" />
4+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5+
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
6+
<inspection_tool class="PhpCSValidationInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
7+
<inspection_tool class="PhpClassNamingConventionInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
8+
<option name="m_regex" value="[a-z][_a-z\d]*" />
9+
<option name="m_minLength" value="0" />
10+
<option name="m_maxLength" value="132" />
11+
</inspection_tool>
12+
<inspection_tool class="PhpConstantNamingConventionInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
13+
<option name="m_minLength" value="0" />
14+
<option name="m_maxLength" value="132" />
15+
</inspection_tool>
16+
<inspection_tool class="PhpDocMissingThrowsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
17+
<inspection_tool class="PhpEnforceDocCommentInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
18+
<option name="CHECK_CONSTANT" value="true" />
19+
<option name="CHECK_FIELD" value="true" />
20+
<option name="CHECK_CLASS_CONSTANT" value="true" />
21+
</inspection_tool>
22+
<inspection_tool class="PhpFunctionNamingConventionInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
23+
<option name="m_minLength" value="0" />
24+
<option name="m_maxLength" value="132" />
25+
</inspection_tool>
26+
<inspection_tool class="PhpMethodNamingConventionInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
27+
<option name="m_regex" value="[a-z][_a-z\d]*" />
28+
<option name="m_minLength" value="0" />
29+
<option name="m_maxLength" value="132" />
30+
</inspection_tool>
31+
<inspection_tool class="PhpPropertyNamingConventionInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
32+
<option name="m_regex" value="[a-z][a-z\d]*" />
33+
<option name="m_minLength" value="0" />
34+
<option name="m_maxLength" value="132" />
35+
</inspection_tool>
36+
<inspection_tool class="PhpUndefinedVariableInspection" enabled="true" level="ERROR" enabled_by_default="true">
37+
<option name="IGNORE_INCLUDE" value="true" />
38+
</inspection_tool>
39+
<inspection_tool class="PhpVariableNamingConventionInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
40+
<option name="m_regex" value="^(CFG|SESSION|USER|COURSE|SITE|PAGE|PERF|DB|THEME|OUTPUT|[a-z][a-z\d]*)$" />
41+
<option name="m_minLength" value="0" />
42+
<option name="m_maxLength" value="132" />
43+
</inspection_tool>
44+
<inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
45+
</profile>
46+
</component>

0 commit comments

Comments
 (0)