From 502aef3d40680570c3e344e524655a840abf3a03 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 5 May 2021 22:05:36 -0700 Subject: [PATCH 1/2] Add cpplint workflow Signed-off-by: Jacob Perron --- .github/workflows/cpplint.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/cpplint.yaml diff --git a/.github/workflows/cpplint.yaml b/.github/workflows/cpplint.yaml new file mode 100644 index 0000000..83de8b2 --- /dev/null +++ b/.github/workflows/cpplint.yaml @@ -0,0 +1,20 @@ +# GitHub Action to run cpplint recursively on all pushes and pull requests +# https://github.com/cpplint/GitHub-Action-for-cpplint + +name: cpplint +on: + # Run for any commit in origin repository + push: + # And pull requests from forks + pull_request: + branches: + # This avoids running the job twice for PRs from origin repository + - '**:**' +jobs: + cpplint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: pip install cpplint + - run: cpplint --recursive --filter=-whitespace/braces --linelength=100 . From 943c013961c1daafe3401e33c3decb84dc1873ae Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 5 May 2021 22:11:08 -0700 Subject: [PATCH 2/2] [wip] Address cpplint errors Signed-off-by: Jacob Perron --- tests/test_create.cpp | 6 ------ tests/test_data.cpp | 8 ++++---- tests/test_serial_query.cpp | 6 +++--- tests/test_serial_stream.cpp | 6 +++--- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/test_create.cpp b/tests/test_create.cpp index aaa8a26..63ef879 100644 --- a/tests/test_create.cpp +++ b/tests/test_create.cpp @@ -44,12 +44,6 @@ TEST(CreateTest, ConstructorSingleParam) create::Create create_roomba_400(create::RobotModel::ROOMBA_400); } -// TEST(CreateTest, ConstructorMultiParam) -// { -// TODO(jacobperron): Document exception thrown and consider defining custom exception -// create::Create create(std::string("/dev/ttyUSB0"), 11520); -// } - TEST(CreateTest, Connected) { create::Create create; diff --git a/tests/test_data.cpp b/tests/test_data.cpp index e9752a0..51a4fb5 100644 --- a/tests/test_data.cpp +++ b/tests/test_data.cpp @@ -28,13 +28,13 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "create/data.h" -#include "create/packet.h" -#include "create/types.h" +#include #include "gtest/gtest.h" -#include +#include "create/data.h" +#include "create/packet.h" +#include "create/types.h" TEST(DataTest, Constructor) { diff --git a/tests/test_serial_query.cpp b/tests/test_serial_query.cpp index b88b101..71694a0 100644 --- a/tests/test_serial_query.cpp +++ b/tests/test_serial_query.cpp @@ -28,12 +28,12 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "create/data.h" -#include "create/serial_query.h" +#include #include "gtest/gtest.h" -#include +#include "create/data.h" +#include "create/serial_query.h" TEST(SerialQueryTest, Constructor) { diff --git a/tests/test_serial_stream.cpp b/tests/test_serial_stream.cpp index 9ae789c..8b95b33 100644 --- a/tests/test_serial_stream.cpp +++ b/tests/test_serial_stream.cpp @@ -28,12 +28,12 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "create/data.h" -#include "create/serial_stream.h" +#include #include "gtest/gtest.h" -#include +#include "create/data.h" +#include "create/serial_stream.h" TEST(SerialStreamTest, Constructor) {