This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How do I troubleshoot KDE kate editor external tools?

Tags: None
(comma "," separated)
romanonefournine
Registered Member
Posts
4
Karma
0
I'm trying to set up a custom external tools in Kate KDE editor.

the tool command looks like:

Code: Select all
/usr/local/bin/pre-commit run --files /home/GIT/ami-factory-test/pipelines-master.yml


and the expected output is (this is what I get when I run it from terminal)
Code: Select all
Check Yaml...............................................................Passed
Check JSON...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
AWS CloudFormation Linter............................(no files to check)Skipped


Image

From the image is visible, that the the %{Document:Path} is resolved correctly.

But when I run the tool in Kate I get following result:
Code: Select all
Check Yaml...........................................(no files to check)Skipped
Check JSON...........................................(no files to check)Skipped
Fix End of Files.....................................(no files to check)Skipped
Trim Trailing Whitespace.............................(no files to check)Skipped
AWS CloudFormation Linter............................(no files to check)Skipped


Which is exactly what I get when I run from the terminal (without the variable resolution):
Code: Select all
$ /usr/local/bin/pre-commit run --files %{Document:Path}


Additionally in the status pane Kate shows:
Code: Select all
Running external tool: pre-commit
- Executable: pre-commit
- Arguments : run --files %{Document:Path}
- Input     :

Finished with exit code: 0


When I hardcode arguments to
Code: Select all
run --files /home/GIT/ami-factory-test/pipelines-master.yml


I get the correct result and status also shows:
Code: Select all
Running external tool: pre-commit
- Executable: pre-commit
- Arguments : run --files /home/GIT/ami-factory-test/pipelines-master.yml
- Input     :

Finished with exit code: 0


How do I find out what I'm doing wrong with respect to the %{Document:Path} variable resolution?

Code: Select all
$ kate --version
kate 19.12.3


Code: Select all
dpkg -l *kate*
====================-==================-============-============================================
ii  kate                 4:19.12.3-0ubuntu1 amd64        powerful text editor
ii  kate5-data           4:19.12.3-0ubuntu1 all          shared data files for Kate text editor
ii  ktexteditor-katepart 5.68.0-0ubuntu1    amd64        provide advanced plain text editing services


Code: Select all
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
User avatar
pvzh
Registered Member
Posts
24
Karma
1
OS
%{Document:Path} does not include the filename. Perhaps %{Document:FilePath} is more appropriate in this case.

In the screenshot I don't see /pipelines-master.yml. Are you going to use the tool by opening this particular file?

Last edited by pvzh on Wed Mar 10, 2021 9:28 am, edited 1 time in total.
romanonefournine
Registered Member
Posts
4
Karma
0
I guess that was it. Thank you


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]