Lint target?
I've created a sensor driver package, and I've added a linter target to it, but it's pretty manual:
FILE(GLOB LINT_SRCS src/*.cpp include/${PROJECT_NAME}/*.h)
add_custom_target(${PROJECT_NAME}_cpplint
COMMAND cpplint --filter=-whitespace/line_length ${LINT_SRCS})
Moreover, the resulting target is "um6_cpplint", whereas the ideal thing would be to have a generic run_lint target which works across every package in a workspace, much like run_tests and all do.
I'm picturing that there could be a roslint package which one would you could add to a package's find_package call. Having done so, it would expose a new macro like add_lint_target(); this could call through to cpplint or pylint (or whatever), with the appropriate configuration for ROS style standards.
Down the road, such a package might also include a package linter, which could warn about incomplete package.xml or gotchas present in CMakeLists, complain about things being in the wrong places, lack of install() macros, etc.
Anyhow, does this seem like something which would be useful? Do any pieces of it exist already?
Why not make the linting part of your automated tests?
It is part of the travis tests already; part of why it would be nice to have a cross-package target would be so that the test script could just be to "catkin_make all run_tests run_lint", rather than needing to include a package-specific target.
No I mean why not define the lint process in one of your tests, such that `make run_tests` invokes cppcheck (or w/e) and checks the result.
bloom does this using pep8 in a nosetest: https://github.com/ros-infrastructure/bloom/blob/master/test/test_code_format.py
Gotcha. That's helpful to see an example of another package doing something similar.