Skip to content

Conversation

@Jgerbrandt
Copy link
Member

@Jgerbrandt Jgerbrandt commented Nov 13, 2023

Clang Formatting

  • Adding Google style clang-formatting on pull request for the Components directory.

  • Adding .DS_Store to the gitignore for MacOS.

@Jgerbrandt Jgerbrandt requested a review from cjchanx November 13, 2023 16:56
@Jgerbrandt Jgerbrandt changed the title Jesse/clang formatting Andromeda v4.6.7 (Clang Formatting) Nov 15, 2023
@Jgerbrandt Jgerbrandt marked this pull request as ready for review November 15, 2023 15:39
@Jgerbrandt
Copy link
Member Author

@shivamdesai04 and @EtSubas Let me know if you have any objections or suggestions for the styling options.

Comment on lines +34 to +36
static void RunTask(void* pvParams) {
UARTTask::Inst().Run(pvParams);
} // Static Task Interface, passes control to the instance Run();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, try to make functions that are a single line inside the class definition stay a single line... though that's oddly specific so 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will do this already if it does not exceed the column limit. The issue here is the comment exceeds the limit.

Comment on lines +50 to +51
bool CopyDataToCommand(uint8_t* dataSrc,
uint16_t size); // Copies the data into the command, into newly allocated memory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to one line if possible.

Maybe note down what clang format option this is, if possible, because it's looks quite bad with how we've previously done comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this is just due to the column limit. We might want to rethink our commenting structure or we disable the column limit.

Copy link

@EtSubas EtSubas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple things none super important most are just small quality things

while (!LL_USART_IsActiveFlag_TXE(kUart_)) {}
}
// Wait until the TX Register Empty Flag is set
while (!LL_USART_IsActiveFlag_TXE(kUart_)) {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there a space here, looks weird

while (..) {
^ space

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's your issue here. The only thing that changed is the tab spacing.

private:
bool bShouldFreeData; // Should the Command handle freeing the data pointer (necessary to enable Command object to handle static memory ptrs)
private:
bool
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird that this is two lines I feel like the commit should be on another line instead of the var name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to column limit. Unfortunately no way to change what gets moved to next line.

#86 (comment)

/* Constants and Macros -------------------------------------------------------*/
constexpr uint16_t DEFAULT_FLASH_SECTOR_SIZE = 4096; // 4KB - Default If Flash was not Initialized (to prevent % by 0 errors)
constexpr uint16_t DEFAULT_FLASH_SECTOR_SIZE =
4096; // 4KB - Default If Flash was not Initialized (to prevent % by 0 errors)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: idk this seems ok but a little weird, I like to have the comment above instead... kinda just preference though so not a huge issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(UBaseType_t)FLASH_TASK_RTOS_PRIORITY,
(TaskHandle_t*)&rtTaskHandle);

BaseType_t rtValue = xTaskCreate((TaskFunction_t)FlashTask::RunTask, (const char*)"FlashTask",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have function call on same line and have the args be pushed to a different line? seems like its not consistent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the line is short enough it will make it one line. Fine imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants