Skip to content

Commit

Permalink
global: fix code style\ngithub: add code_style workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
and3rson committed Mar 9, 2024
1 parent 7860c00 commit d925e8d
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 17 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: code_style

on: [push]

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Run code style checks
run: |
apt update -y
apt install -y make clang-format
make lint
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ all:
todo:
@# Find all files, but exclude .pio and .ccls-cache directories
@# Preserve colors in output
@# Print file and line on separate lines
@find \
. \
-not \( -name .ccls-cache -prune \) \
Expand All @@ -30,3 +29,20 @@ todo:
-o -iname *.h \
-o -iname *.rst \
| xargs grep --color=always -n -H -E "TODO|FIXME|XXX" \

.PHONY: lint
lint:
# Find all files, but exclude .pio and .ccls-cache directories
# Preserve colors in output
find \
. \
-not \( -name .ccls-cache -prune \) \
-not \( -name .pio -prune \) \
-not \( -name mjs -prune \) \
-not \( -name doomgeneric -prune \) \
-iname *.h \
-o -iname *.cpp \
-o -iname *.c \
-o -iname *.hpp \
-o -iname *.h \
| xargs clang-format --dry-run --Werror
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Documentation Status](https://readthedocs.org/projects/lilka/badge/?version=latest)](https://docs.lilka.dev)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/and3rson/library/Lilka.svg)](https://registry.platformio.org/libraries/and3rson/Lilka)
[![firmware/hashbrown](https://github.com/and3rson/lilka/actions/workflows/firmware_hashbrown.yml/badge.svg)](https://github.com/and3rson/lilka/actions/workflows/firmware_hashbrown.yml)
[![code style](https://github.com/and3rson/lilka/actions/workflows/code_style.yml/badge.svg)](https://github.com/and3rson/lilka/actions/workflows/code_style.yml)
[![Discord](https://img.shields.io/discord/1202315568846213172?label=Discord)][discord]

DIY-консоль, яку можна зібрати з дешевих готових модулів.
Expand Down
2 changes: 1 addition & 1 deletion firmware/hashbrown/src/apps/lua/lualilka_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

int lualilka_controller_getState(lua_State* L) {
lilka::State state = lilka::controller.getState();
lilka::_StateButtons &buttons = *reinterpret_cast<lilka::_StateButtons *>(&state);
lilka::_StateButtons& buttons = *reinterpret_cast<lilka::_StateButtons*>(&state);
lua_createtable(L, 0, 10);
// Push up, down, left, right, a, b, c, d, select, start to the table
const char* keys[] = {"up", "down", "left", "right", "a", "b", "c", "d", "select", "start"};
Expand Down
3 changes: 1 addition & 2 deletions firmware/template/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ void setup() {
lilka::begin();
}

void loop() {
}
void loop() {}
2 changes: 1 addition & 1 deletion sdk/lib/lilka/src/lilka.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ namespace lilka {
///
/// Рекомендується викликати цю функцію один раз на початку програми в вашій функції ``setup()``.
void begin();
}
} // namespace lilka

#endif // LILKA_H
129 changes: 117 additions & 12 deletions sdk/lib/lilka/src/lilka/buzzer.cpp

Large diffs are not rendered by default.

0 comments on commit d925e8d

Please sign in to comment.