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 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