fkie/catkin_lint

Rule 'plugins'?

Closed this issue · 6 comments

Something which came up in a discussion here: would it be possible (or perhaps better: interesting) to add a sort of plugin system to catkin_lint which would allow packages to contribute additional and specialised rules which catkin_lint would then add to its own rule set and check for?

Certain labs and companies have specific in-house styles and conventions for packaging (ROS) components, and it would be great if catkin_lint could check and flag violations against such conventions.

I haven't checked the feasibility, but would that be something that would be possible with the current architecture of catkin_lint?

Actually, this has been possible since day one, even though I'm not aware of anyone ever using this feature: http://fkie.github.io/catkin_lint/api/

Nice.

Not sure how I've missed that all these years.

Thanks.

Quick question: IIUC the plugin linters "just" need to be present on the PYTHONPATH, correct? Is that sufficient for them to be discoverable and loadable by catkin_lint -c ..?


Edit: would you happen to have any examples?


Edit 2: hm, I guess catkin_lint/checks/__init__.py is an "example".

Everything in the checks module counts as example ;-)

One thing that is missing is that you cannot yet add custom messages. I'll have to go ahead and add something to the API for that.

Oh, and the -c option replaces the default modules. But you can have a comma-separated list with multiple modules, so something like -c all,mymodule.myfunc should work.

I went ahead and added something to the API for that.

That's really nice. Thanks for this.

👍