Fix codestyle check pipeline (#178)
* change continue-on-error to false * add manual trigger * revert manual trigger * test fail checkstyle * restore prev trigger and settings * fix syntax * fix exit code for codestyle * try to break pipeline * restore pipeline Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
parent
d33e16dae1
commit
7570ac08a9
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Check syntax
|
- name: Check syntax
|
||||||
uses: ./.github/actions/docker
|
uses: ./.github/actions/docker
|
||||||
continue-on-error: true
|
continue-on-error: false
|
||||||
with:
|
with:
|
||||||
run: /syntax_check.sh
|
run: /syntax_check.sh
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ void fatfs_list(void* p) {
|
|||||||
|
|
||||||
furi_log = get_default_log();
|
furi_log = get_default_log();
|
||||||
|
|
||||||
FuriRecordSubscriber* fb_record = furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
|
FuriRecordSubscriber* fb_record =
|
||||||
|
furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
|
||||||
if(fb_record == NULL) {
|
if(fb_record == NULL) {
|
||||||
fuprintf(furi_log, "[widget][fatfs_list] cannot create fb record\n");
|
fuprintf(furi_log, "[widget][fatfs_list] cannot create fb record\n");
|
||||||
furiac_exit(NULL);
|
furiac_exit(NULL);
|
||||||
|
@ -5,7 +5,8 @@ void u8g2_example(void* p) {
|
|||||||
FuriRecordSubscriber* log = get_default_log();
|
FuriRecordSubscriber* log = get_default_log();
|
||||||
|
|
||||||
// open record
|
// open record
|
||||||
FuriRecordSubscriber* fb_record = furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
|
FuriRecordSubscriber* fb_record =
|
||||||
|
furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
|
||||||
|
|
||||||
if(fb_record == NULL) {
|
if(fb_record == NULL) {
|
||||||
fuprintf(log, "[widget] cannot create fb record\n");
|
fuprintf(log, "[widget] cannot create fb record\n");
|
||||||
|
@ -14,7 +14,8 @@ void u8g2_qrcode(void* p) {
|
|||||||
FuriRecordSubscriber* log = get_default_log();
|
FuriRecordSubscriber* log = get_default_log();
|
||||||
|
|
||||||
// open record
|
// open record
|
||||||
FuriRecordSubscriber* fb_record = furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
|
FuriRecordSubscriber* fb_record =
|
||||||
|
furi_open_deprecated("u8g2_fb", false, false, NULL, NULL, NULL);
|
||||||
|
|
||||||
// Allocate a chunk of memory to store the QR code
|
// Allocate a chunk of memory to store the QR code
|
||||||
// https://github.com/ricmoo/QRCode
|
// https://github.com/ricmoo/QRCode
|
||||||
|
@ -29,8 +29,8 @@ GUIEvent* gui_event_alloc() {
|
|||||||
assert(gui_event->mqueue);
|
assert(gui_event->mqueue);
|
||||||
|
|
||||||
// Input
|
// Input
|
||||||
gui_event->input_event_record =
|
gui_event->input_event_record = furi_open_deprecated(
|
||||||
furi_open_deprecated("input_events", false, false, gui_event_input_events_callback, NULL, gui_event);
|
"input_events", false, false, gui_event_input_events_callback, NULL, gui_event);
|
||||||
assert(gui_event->input_event_record != NULL);
|
assert(gui_event->input_event_record != NULL);
|
||||||
// Lock mutex
|
// Lock mutex
|
||||||
gui_event->lock_mutex = osMutexNew(NULL);
|
gui_event->lock_mutex = osMutexNew(NULL);
|
||||||
@ -58,7 +58,8 @@ void gui_event_unlock(GUIEvent* gui_event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void gui_event_messsage_send(GUIEvent* gui_event, GUIMessage* message) {
|
void gui_event_messsage_send(GUIEvent* gui_event, GUIMessage* message) {
|
||||||
assert(gui_event); assert(message);
|
assert(gui_event);
|
||||||
|
assert(message);
|
||||||
osMessageQueuePut(gui_event->mqueue, message, 0, 0);
|
osMessageQueuePut(gui_event->mqueue, message, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ void menu_task(void* p) {
|
|||||||
furiac_exit(NULL);
|
furiac_exit(NULL);
|
||||||
}
|
}
|
||||||
furiac_ready();
|
furiac_ready();
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
MenuMessage m = menu_event_next(menu->event);
|
MenuMessage m = menu_event_next(menu->event);
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ void test_furi_valuemutex() {
|
|||||||
//read mutex blocking case
|
//read mutex blocking case
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TEST: concurrent access
|
TEST: concurrent access
|
||||||
|
|
||||||
|
@ -67,7 +67,6 @@ MU_TEST_SUITE(test_suite) {
|
|||||||
MU_RUN_TEST(mu_test_furi_create_open);
|
MU_RUN_TEST(mu_test_furi_create_open);
|
||||||
MU_RUN_TEST(mu_test_furi_valuemutex);
|
MU_RUN_TEST(mu_test_furi_valuemutex);
|
||||||
MU_RUN_TEST(mu_test_furi_concurrent_access);
|
MU_RUN_TEST(mu_test_furi_concurrent_access);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int run_minunit() {
|
int run_minunit() {
|
||||||
|
@ -12,15 +12,10 @@ void COPY_COMPOSE(void* ctx, void* state) {
|
|||||||
read_mutex((ValueMutex*)ctx, state, 0);
|
read_mutex((ValueMutex*)ctx, state, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum {
|
typedef enum { UiLayerBelowNotify UiLayerNotify, UiLayerAboveNotify } UiLayer;
|
||||||
UiLayerBelowNotify
|
|
||||||
UiLayerNotify,
|
|
||||||
UiLayerAboveNotify
|
|
||||||
} UiLayer;
|
|
||||||
|
|
||||||
ValueComposerHandle* add_compose_layer(
|
ValueComposerHandle*
|
||||||
ValueComposer* composer, ValueComposerCallback cb, void* ctx, uint32_t layer
|
add_compose_layer(ValueComposer* composer, ValueComposerCallback cb, void* ctx, uint32_t layer);
|
||||||
);
|
|
||||||
|
|
||||||
bool remove_compose_layer(ValueComposerHandle* handle);
|
bool remove_compose_layer(ValueComposerHandle* handle);
|
||||||
|
|
||||||
@ -44,7 +39,6 @@ typedef struct {
|
|||||||
PubSub pubsub;
|
PubSub pubsub;
|
||||||
} ValueManager;
|
} ValueManager;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
acquire value, changes it and send notify with current value.
|
acquire value, changes it and send notify with current value.
|
||||||
*/
|
*/
|
||||||
|
@ -17,13 +17,17 @@ For transmit/receive data use `spi_xfer` function.
|
|||||||
*/
|
*/
|
||||||
bool spi_xfer(
|
bool spi_xfer(
|
||||||
SPI_HandleTypeDef* spi,
|
SPI_HandleTypeDef* spi,
|
||||||
uint8_t* tx_data, uint8_t* rx_data, size_t len,
|
uint8_t* tx_data,
|
||||||
PubSubCallback cb, void* ctx);
|
uint8_t* rx_data,
|
||||||
|
size_t len,
|
||||||
|
PubSubCallback cb,
|
||||||
|
void* ctx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Blocking verison:
|
Blocking verison:
|
||||||
*/
|
*/
|
||||||
static inline bool spi_xfer_block(SPI_HandleTypeDef* spi, uint8_t* tx_data, uint8_t* rx_data, size_t len) {
|
static inline bool
|
||||||
|
spi_xfer_block(SPI_HandleTypeDef* spi, uint8_t* tx_data, uint8_t* rx_data, size_t len) {
|
||||||
semaphoreInfo s;
|
semaphoreInfo s;
|
||||||
osSemaphore block = createSemaphoreStatic(s);
|
osSemaphore block = createSemaphoreStatic(s);
|
||||||
if(!spi_xfer(spi, tx_data, rx_data, len, RELEASE_SEMAPHORE, (void*)block)) {
|
if(!spi_xfer(spi, tx_data, rx_data, len, RELEASE_SEMAPHORE, (void*)block)) {
|
||||||
@ -52,15 +56,15 @@ typedef struct {
|
|||||||
ValueMutex* bus; ///< <SpiBus*>
|
ValueMutex* bus; ///< <SpiBus*>
|
||||||
} SpiDevice;
|
} SpiDevice;
|
||||||
|
|
||||||
## SPI IRQ device
|
##SPI IRQ device
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Many devices (like CC1101 and NFC) present as SPI bus and IRQ line.
|
Many devices (like CC1101 and NFC) present as SPI bus and IRQ line.
|
||||||
For work with it there is special entity `SpiIrqDevice`.
|
For work with it there is special entity `SpiIrqDevice`.
|
||||||
Use `subscribe_pubsub` for subscribinq to irq events.
|
Use `subscribe_pubsub` for subscribinq to irq events.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ValueMutex* bus; ///< <SpiBus*>
|
ValueMutex* bus; ///< <SpiBus*>
|
||||||
PubSub* irq;
|
PubSub* irq;
|
||||||
} SpiIrqDevice;
|
} SpiIrqDevice;
|
||||||
@ -75,7 +79,6 @@ typedef struct {
|
|||||||
ValueMutex* spi; ///< <SPI_HandleTypeDef*>
|
ValueMutex* spi; ///< <SPI_HandleTypeDef*>
|
||||||
} DisplayBus;
|
} DisplayBus;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ValueMutex* bus; ///< <DisplayBus*>
|
ValueMutex* bus; ///< <DisplayBus*>
|
||||||
} DisplayDevice;
|
} DisplayDevice;
|
||||||
|
@ -26,7 +26,7 @@ rust_syntax_rc=$?
|
|||||||
|
|
||||||
if [[ $rust_syntax_rc -eq 0 ]] && [[ $c_syntax_rc -eq 0 ]]; then
|
if [[ $rust_syntax_rc -eq 0 ]] && [[ $c_syntax_rc -eq 0 ]]; then
|
||||||
echo "Code looks fine for me!"
|
echo "Code looks fine for me!"
|
||||||
exit 1
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "Do you want fix syntax? (y/n): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
|
read -p "Do you want fix syntax? (y/n): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
|
||||||
@ -38,4 +38,4 @@ cd $PROJECT_DIR
|
|||||||
# We use root in container and clang-format rewriting files. We'll need change owner to original
|
# We use root in container and clang-format rewriting files. We'll need change owner to original
|
||||||
local_user=$(stat -c '%u' .clang-format)
|
local_user=$(stat -c '%u' .clang-format)
|
||||||
$CLANG_FORMAT_BIN -style=file -i $C_FILES
|
$CLANG_FORMAT_BIN -style=file -i $C_FILES
|
||||||
chown $local_user $C_FILES
|
chown $local_user $C_FILES
|
||||||
|
Loading…
Reference in New Issue
Block a user