From 21a6d7a2f82673949acb0df892c36a7d98a4587b Mon Sep 17 00:00:00 2001 From: Manoel Vilela Date: Sun, 2 Nov 2025 10:04:15 -0300 Subject: [PATCH 1/2] feat(ci): add lint state with cppcheck added as well "make wc" target to analysis distribution of LoC of the project. --- .github/workflows/ci.yml | 13 +++++++++++++ Makefile | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95450af5..ca29fca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,3 +25,16 @@ jobs: - uses: actions/checkout@v3 - name: Run make check-valgrind run: make check-valgrind + + make-lint: + runs-on: ubuntu-latest + + steps: + - name: Install cppcheck + run: | + sudo apt install cppcheck -y + echo "cppcheck installed" + + - uses: actions/checkout@v3 + - name: Run make lint + run: make lint diff --git a/Makefile b/Makefile index e8235f5d..0739fdf6 100644 --- a/Makefile +++ b/Makefile @@ -137,4 +137,13 @@ docs-publish: tags: $(SOURCES) ctags -Re -f TAGS src/ +wc: + @echo "LINES\tWORDS\tMAX-LINE" + @find src -regextype posix-extended -regex ".*\.(c|h)" \ + | xargs wc --lines --words --max-line-length \ + | sort -n + +lint: + cppcheck $(SRCDIR) + .PHONY: clean docs From 4d0498817edfe5a2d82570811c120bf9f6a798f4 Mon Sep 17 00:00:00 2001 From: Manoel Vilela Date: Sun, 2 Nov 2025 10:45:54 -0300 Subject: [PATCH 2/2] chore: fix cosmetic code issues --- src/graph/graph.c | 4 ++-- src/list/single/list-gen.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graph/graph.c b/src/graph/graph.c index 96014eef..5a3c4bf6 100644 --- a/src/graph/graph.c +++ b/src/graph/graph.c @@ -8,8 +8,8 @@ struct Graph { HashTableGen *adj; bool directed; // true by default - bool weighted; - bool tarjan; // false by default + bool weighted; // false by default + bool tarjan; // false by default }; Graph* graph_create() { diff --git a/src/list/single/list-gen.h b/src/list/single/list-gen.h index ec3a0513..ec89598d 100644 --- a/src/list/single/list-gen.h +++ b/src/list/single/list-gen.h @@ -131,4 +131,4 @@ ListGen* list_gen_concat(ListGen *l1, ListGen *l2); */ void list_gen_println_reverse(ListGen *l); -#endif \ No newline at end of file +#endif