idanpa / vscode-checkpatch

Visual Studio Code extension for using linux kernel checkpatch tool to lint code.
https://marketplace.visualstudio.com/items?itemName=idanp.checkpatch
MIT License
11 stars 4 forks source link

Checkpatch: calling 'checkpatch.pl' failed [...] #11

Closed mku514k closed 1 day ago

mku514k commented 4 days ago

I'm trying to set up checkpatch extension but no matter what I do, I get following error message:

Checkpatch: calling 'checkpatch.pl' failed, please check checkpatch.checkpatchPath and checkpatch.checkpatchPath configutations.

I have checkpatch.pl in /usr/bin, made it executable, set up privlages as in INSTALATION and verified I can execute it manually. I ran out of ideas what might be wrong, maybe some vscode update broke the extension? I use extension on remote Debian 12 machine.

idanpa commented 2 days ago

Probably some problems with your arguments in checkpatch.checkpatchArgs setting. Version 0.0.9 published with better error prints that should help pinpoint the problem. Please let me know what you see.

mku514k commented 1 day ago

Thanks, those error prints were the key to resolve the issue.

The problem was that the repo I contribute to, uses checkpatch GHA that uses fork of checkpatch.pl underneath.

This fork has support for --exclude option and it is widely used in .checkpatch.conf. This explains the error I'm getting. image

Removing said options from .checkpatch.conf resolves the issue.

The issue can be closed, additional error prints is great improvement!

idanpa commented 1 day ago

Great. BTW - Instead of removing the --excludes from your .checkpatch.conf, you can let the extension use this fork of checkpatch by installing the modified script in your system or setting checkpatch.checkpatchPath to its path.

mku514k commented 18 hours ago

I tried that, but looks like the fork has some deeper level changes and does not work with extension. We'll resolve this by creating separate .checkpatch.conf just for github action :)

idanpa commented 17 hours ago

I tried to use checkpatch.pl from https://github.com/zephyrproject-rtos/zephyr/blob/main/scripts/checkpatch.pl it seems to work for some basic file with some basic lint problems.

Feel free to send the problems you encountered, I might be able to help.