Naming and coding style convention, new linter tool. (#945)

* Makefile, Scripts: new linter
* About: remove ID from IC
* Firmware: remove double define for DIVC/DIVR
* Scripts: check folder names too. Docker: replace syntax check with make lint.
* Reformat Sources and Migrate to new file naming convention
* Docker: symlink clang-format-12 to clang-format
* Add coding style guide
This commit is contained in:
あく
2022-01-05 19:10:18 +03:00
committed by GitHub
parent c98e54da10
commit 389ff92cc1
899 changed files with 379245 additions and 373421 deletions
@@ -1,4 +1,4 @@
#include "file-worker.h"
#include "file_worker.h"
#include <m-string.h>
#include <lib/toolbox/hex.h>
#include <dialogs/dialogs.h>
@@ -1,4 +1,4 @@
#include "file-worker-cpp.h"
#include "file_worker_cpp.h"
#include <lib/toolbox/hex.h>
FileWorkerCpp::FileWorkerCpp(bool _silent) {
@@ -67,8 +67,14 @@ bool FileWorkerCpp::file_select(
file_worker, path, extension, result, result_size, selected_filename);
}
bool FileWorkerCpp::read_until_buffered(string_t str_result, char* file_buf, size_t* file_buf_cnt, size_t max_length, char separator) {
return file_worker_read_until_buffered(file_worker, str_result, file_buf, file_buf_cnt, max_length, separator);
bool FileWorkerCpp::read_until_buffered(
string_t str_result,
char* file_buf,
size_t* file_buf_cnt,
size_t max_length,
char separator) {
return file_worker_read_until_buffered(
file_worker, str_result, file_buf, file_buf_cnt, max_length, separator);
}
bool FileWorkerCpp::get_value_from_key(string_t key, char delimiter, string_t value) {
@@ -86,4 +92,3 @@ bool FileWorkerCpp::rename(const char* old_path, const char* new_path) {
bool FileWorkerCpp::check_errors() {
return file_worker_check_errors(file_worker);
}
@@ -1,5 +1,5 @@
#pragma once
#include "file-worker.h"
#include "file_worker.h"
/**
* @brief File operations helper class.
@@ -141,7 +141,12 @@ public:
* @param separator
* @return true on success
*/
bool read_until_buffered(string_t str_result, char* file_buf, size_t* file_buf_cnt, size_t max_length, char separator = '\n');
bool read_until_buffered(
string_t str_result,
char* file_buf,
size_t* file_buf_cnt,
size_t max_length,
char separator = '\n');
/**
* @brief Gets value from key
@@ -162,9 +167,7 @@ public:
* @param exist - flag to show file exist
* @return true on success
*/
bool is_file_exist(
const char* filename,
bool* exist);
bool is_file_exist(const char* filename, bool* exist);
/**
* @brief Rename file or directory
@@ -173,9 +176,7 @@ public:
* @param new_filename
* @return true on success
*/
bool rename(
const char* old_path,
const char* new_path);
bool rename(const char* old_path, const char* new_path);
/**
* @brief Check errors
@@ -113,8 +113,8 @@ public:
return result;
}
bool
has_previous_scene(const std::initializer_list<typename TApp::SceneType>& scene_index_list) {
bool has_previous_scene(
const std::initializer_list<typename TApp::SceneType>& scene_index_list) {
bool result = false;
for(auto const& previous_element : previous_scenes_list) {
@@ -1,4 +1,4 @@
#include "text-store.h"
#include "text_store.h"
#include <furi.h>
TextStore::TextStore(uint8_t _text_size)
@@ -1,5 +1,5 @@
#pragma once
#include "view-modules/generic-view-module.h"
#include "view_modules/generic_view_module.h"
#include <map>
#include <furi/check.h>
#include <gui/view_dispatcher.h>
@@ -160,4 +160,4 @@ private:
view_dispatcher_add_view(view_dispatcher, static_cast<uint32_t>(view_index), view);
view_set_previous_callback(view, previous_view_callback_pointer);
}
};
};
@@ -1,4 +1,4 @@
#include "byte-input-vm.h"
#include "byte_input_vm.h"
ByteInputVM::ByteInputVM() {
byte_input = byte_input_alloc();
@@ -1,5 +1,5 @@
#pragma once
#include "generic-view-module.h"
#include "generic_view_module.h"
#include <gui/modules/byte_input.h>
class ByteInputVM : public GenericViewModule {
@@ -1,4 +1,4 @@
#include "dialog-ex-vm.h"
#include "dialog_ex_vm.h"
DialogExVM::DialogExVM() {
dialog_ex = dialog_ex_alloc();
@@ -1,5 +1,5 @@
#pragma once
#include "generic-view-module.h"
#include "generic_view_module.h"
#include <gui/modules/dialog_ex.h>
class DialogExVM : public GenericViewModule {
@@ -1,4 +1,4 @@
#include "popup-vm.h"
#include "popup_vm.h"
PopupVM::PopupVM() {
popup = popup_alloc();
}
@@ -1,5 +1,5 @@
#pragma once
#include "generic-view-module.h"
#include "generic_view_module.h"
#include <gui/modules/popup.h>
class PopupVM : public GenericViewModule {
@@ -1,4 +1,4 @@
#include "submenu-vm.h"
#include "submenu_vm.h"
SubmenuVM::SubmenuVM() {
submenu = submenu_alloc();
@@ -1,5 +1,5 @@
#pragma once
#include "generic-view-module.h"
#include "generic_view_module.h"
#include <gui/modules/submenu.h>
class SubmenuVM : public GenericViewModule {
@@ -1,4 +1,4 @@
#include "text-input-vm.h"
#include "text_input_vm.h"
TextInputVM::TextInputVM() {
text_input = text_input_alloc();
@@ -22,7 +22,8 @@ void TextInputVM::set_result_callback(
char* text,
uint8_t max_text_length,
bool clear_default_text) {
text_input_set_result_callback(text_input, callback, callback_context, text, max_text_length, clear_default_text);
text_input_set_result_callback(
text_input, callback, callback_context, text, max_text_length, clear_default_text);
}
void TextInputVM::set_header_text(const char* text) {
@@ -1,5 +1,5 @@
#pragma once
#include "generic-view-module.h"
#include "generic_view_module.h"
#include <gui/modules/text_input.h>
class TextInputVM : public GenericViewModule {