[utilities/kate] /: Add formatting for perl files using perltidy
Christoph Cullmann <[email protected]>
| Newsgroups | gmane.comp.kde.cvs,gmane.comp.kde.doc |
|---|---|
| Message-ID | <[email protected]> |
Git commit 4c01804067fbcf55a4a036adbe49bfd42565b716 by Christoph Cullmann, on behalf of Allen Winter.
Committed on 15/08/2026 at 12:23.
Pushed by cullmann into branch 'master'.
Add formatting for perl files using perltidy
Now perl files can be auto-formatted when saved.
M +6 -0 addons/format/FormatterSettings.json
M +2 -0 addons/format/Formatters.cpp
M +1 -0 doc/kate/plugins.docbook
https://invent.kde.org/utilities/kate/-/commit/4c01804067fbcf55a4a036adbe49bfd42565b716
diff --git a/addons/format/FormatterSettings.json b/addons/format/FormatterSettings.json
index 181a4022fa..48fd91eafd 100644
--- a/addons/format/FormatterSettings.json
+++ b/addons/format/FormatterSettings.json
@@ -75,6 +75,12 @@
"-s"
]
},
+ "perltidy": {
+ "command": [
+ "perltidy",
+ "-pro=.../.perltidyrc"
+ ]
+ },
"prettier": {
"command": [
"prettier"
diff --git a/addons/format/Formatters.cpp b/addons/format/Formatters.cpp
index 2ce6bcd95c..e5cb4099f0 100644
--- a/addons/format/Formatters.cpp
+++ b/addons/format/Formatters.cpp
@@ -323,6 +323,8 @@ static Formatter makeFormatter(KTextEditor::Document *doc, const QJsonObject &co
return newStdinFmt("erlfmt", {});
} else if (is("godot")) {
return newStdinFmt("gdformat", {});
+ } else if (is("perl")) {
+ return newStdinFmt("perltidy", {});
}
return {};
#undef S
diff --git a/doc/kate/plugins.docbook b/doc/kate/plugins.docbook
index 14fbb9af02..41d412b7da 100644
--- a/doc/kate/plugins.docbook
+++ b/doc/kate/plugins.docbook
@@ -4971,6 +4971,7 @@ The current list of supported languages and formatters are as follows:
<listitem><para>Swift - <command>swiftformat</command></para></listitem>
<listitem><para>Erlang - <command>erlfmt</command></para></listitem>
<listitem><para>Godot Script - <command>gdformat</command></para></listitem>
+<listitem><para>Perl - <command>perltidy</command></para></listitem>
<listitem><para>Python
<itemizedlist>