Compare commits

...

10 commits

Author SHA1 Message Date
Aiden Fuller
0cd0a4343a
Merge pull request #6 from huyz/clarify-labels-of-mode-and-action 2025-07-12 11:12:10 +10:00
Huy Z
37bc9b3dad
Clarify labels of mode and action 2025-06-22 18:56:16 +07:00
Aiden Fuller
e15b805427
Update README.md 2025-04-19 11:18:46 +10:00
Aiden Fuller
5c7c2b38af
Update README.md 2025-04-19 11:18:37 +10:00
Aiden Fuller
71bf2bfc5b Fixes 2025-04-17 11:56:41 +10:00
Aiden Fuller
ad225b4e25 Upgraded to 2025.1 2025-04-17 11:25:07 +10:00
Aiden Fuller
747b1bee17
Create README.md 2025-04-11 21:11:50 +10:00
Aiden Fuller
c464efa4cd Fixes to versioning 2025-03-31 12:40:47 +11:00
Aiden Fuller
32b0d4299e Fixes 2025-03-29 14:57:08 +11:00
Aiden Fuller
a637e549ce New version 2025-03-29 14:55:32 +11:00
10 changed files with 57 additions and 32 deletions

2
.idea/.name generated
View file

@ -1 +1 @@
hello-world-plugin commit-message-prefixer

16
.idea/csv-editor.xml generated
View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CsvFileAttributes">
<option name="attributeMap">
<map>
<entry key="/foo">
<value>
<Attribute>
<option name="separator" value="," />
</Attribute>
</value>
</entry>
</map>
</option>
</component>
</project>

15
.idea/git_toolbox_prj.xml generated Normal file
View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>

1
.idea/gradle.xml generated
View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>

15
README.md Normal file
View file

@ -0,0 +1,15 @@
A plugin for JetBrains IDEs that automatically prefixes commit messages with information extracted from branch names.
You can find the plugin here: https://plugins.jetbrains.com/plugin/26938-commit-message-prefixer
Features:
- Extract information from branch names using configurable regex patterns
- Format commit messages using configurable format patterns
- Enable/disable the plugin from the commit dialog
The branch name extraction pattern is configurable from the IDE settings
Example:
- Branch name: `feature/12345-add-new-feature`
- Commit message: `Initial implementation`
- Result: `#12345 - Initial implementation`

View file

@ -4,7 +4,7 @@ plugins {
} }
group = 'org.cobalyte' group = 'org.cobalyte'
version = '1.0.0' version = '1.2.1'
repositories { repositories {
mavenCentral() mavenCentral()
@ -12,7 +12,7 @@ repositories {
// Configure Gradle IntelliJ Plugin // Configure Gradle IntelliJ Plugin
intellij { intellij {
version = '2023.1.5' version = '2024.3.5'
type = 'IC' // Target IDE Platform - IC for IntelliJ IDEA Community Edition type = 'IC' // Target IDE Platform - IC for IntelliJ IDEA Community Edition
} }
@ -24,7 +24,7 @@ dependencies {
// Configure plugin metadata // Configure plugin metadata
patchPluginXml { patchPluginXml {
sinceBuild = '231' sinceBuild = '231'
untilBuild = '241.*' untilBuild = ''
pluginDescription = ''' pluginDescription = '''
A plugin for JetBrains IDEs that automatically prefixes commit messages with information extracted from branch names. A plugin for JetBrains IDEs that automatically prefixes commit messages with information extracted from branch names.
@ -43,7 +43,22 @@ patchPluginXml {
<li>Result: "#12345 - Initial implementation"</li> <li>Result: "#12345 - Initial implementation"</li>
</ul> </ul>
''' '''
changeNotes = 'Initial release of the Commit Message Prefixer plugin' changeNotes = '''
<h3>Version 1.2.1</h3>
<ul>
<li>Added support for 2025.1</li>
</ul>
<h3>Version 1.2.0</h3>
<ul>
<li>Extended compatibility to support 2024.3.x IDEs including Rider 2024.3.6</li>
</ul>
<h3>Version 1.1.0</h3>
<ul>
<li>Initial release of the Commit Message Prefixer plugin</li>
</ul>
'''
} }
test { test {

View file

@ -50,11 +50,6 @@ public class CommitPrefixerCheckinHandlerFactory extends CheckinHandlerFactory {
return checkBox; return checkBox;
} }
@Override
public void refresh() {
checkBox.setSelected(settings.isEnabled());
}
@Override @Override
public void saveState() { public void saveState() {
settings.setEnabled(checkBox.isSelected()); settings.setEnabled(checkBox.isSelected());

View file

@ -71,8 +71,8 @@ public class CommitPrefixerConfigurable implements Configurable {
formatHelp.setForeground(JBColor.GRAY); formatHelp.setForeground(JBColor.GRAY);
JBLabel prefixingHelp = new JBLabel("<html>Select how the prefix should be added to commit messages:<br>" + JBLabel prefixingHelp = new JBLabel("<html>Select how the prefix should be added to commit messages:<br>" +
"<b>Pre-fill in commit dialog</b>: You need to click the 'Add Prefix' button in the commit dialog.<br>" + "<b>Manual</b>: You manually click the 'Add Prefix' button in the commit tool window.<br>" +
"<b>Before commit</b>: The prefix will be added automatically before commit.</html>"); "<b>Automatic</b>: The prefix is added automatically after you click Commit.</html>");
prefixingHelp.setForeground(JBColor.GRAY); prefixingHelp.setForeground(JBColor.GRAY);
// Build the form // Build the form
@ -99,7 +99,7 @@ public class CommitPrefixerConfigurable implements Configurable {
} }
@Override @Override
public void apply() throws ConfigurationException { public void apply() {
CommitPrefixerSettings settings = CommitPrefixerSettings.getInstance(project); CommitPrefixerSettings settings = CommitPrefixerSettings.getInstance(project);
settings.setBranchExtractionPattern(branchExtractionPatternField.getText()); settings.setBranchExtractionPattern(branchExtractionPatternField.getText());
settings.setCommitMessageFormat(commitMessageFormatField.getText()); settings.setCommitMessageFormat(commitMessageFormatField.getText());

View file

@ -31,8 +31,8 @@ public class CommitPrefixerSettings implements PersistentStateComponent<CommitPr
// Enum for prefixing modes // Enum for prefixing modes
public enum PrefixingMode { public enum PrefixingMode {
MANUAL("Pre-fill in commit dialog"), MANUAL("Manual"),
AUTOMATIC("Before commit"); AUTOMATIC("Automatic");
private final String displayName; private final String displayName;

View file

@ -45,7 +45,7 @@
<!-- Add the commit prefix action to the VCS menu --> <!-- Add the commit prefix action to the VCS menu -->
<action id="org.cobalyte.AddCommitPrefixAction" <action id="org.cobalyte.AddCommitPrefixAction"
class="org.cobalyte.AddCommitPrefixAction" class="org.cobalyte.AddCommitPrefixAction"
text="Add Prefix" text="Add Prefix to Commit Message"
description="Add a prefix to the commit message based on the current branch name"> description="Add a prefix to the commit message based on the current branch name">
<add-to-group group-id="Vcs.MessageActionGroup" anchor="first"/> <add-to-group group-id="Vcs.MessageActionGroup" anchor="first"/>
</action> </action>