flux-framework / flux-core

core services for the Flux resource management framework
GNU Lesser General Public License v3.0
162 stars 49 forks source link

idea: add script like kernel checkpatch.pl #2143

Open garlick opened 5 years ago

garlick commented 5 years ago

This weekend on one of my personal projects that invovles kernel modules, I played around with checkpatch.pl, the linux kernel's checker that ensures patches conform to the linux kernel coding style.

In addition to checking for things like spacing and use of deprecated interfaces, it has knowledge of the kernel API and can look for some typical problem areas such as a memory barrier without an explanatory comment, or use of one api element without another required one.

We might benefit by having something like this for flux, maybe initially just to identify project style violations, but built to be expanded to find other common problems, especially those that people unfamiliar with the code might fall into easily.

chu11 commented 5 years ago

This reminds me that in several Apache projects, their patch submission checker also reports (and might by default fail a patch submission) if no new tests are added. A patch accepter can override the no new tests requirement (i.e. trivial fixes), but I like the check in general. For new contributors, it immediately notifies you of a requirement you are missing or asks you to explain why there aren't any new tests.