-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add code formatting check to CI #3778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit b4968ec.
| FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat)); | ||
| } | ||
| CmdArgBuffer::CmdArgBuffer(const U8* args, FwSizeType size) { | ||
| SerializeStatus stat = this->setBuff(args, size); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat)); | ||
| } | ||
| CmdArgBuffer::CmdArgBuffer(const U8* args, FwSizeType size) { | ||
| SerializeStatus stat = this->setBuff(args, size); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return *this; | ||
| } | ||
| CmdArgBuffer::CmdArgBuffer(const CmdArgBuffer& other) : Fw::SerializeBufferBase() { | ||
| SerializeStatus stat = this->setBuff(other.m_bufferData, other.getBuffLength()); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| } | ||
|
|
||
| SerializeStatus CmdPacket::deserialize(SerializeBufferBase& buffer) { | ||
| SerializeStatus stat = ComPacket::deserializeBase(buffer); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat)); | ||
| } | ||
| ComBuffer::ComBuffer(const U8* args, FwSizeType size) { | ||
| SerializeStatus stat = SerializeBufferBase::setBuff(args, size); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| FW_ASSERT(FW_SERIALIZE_OK == stat,static_cast<FwAssertArgType>(stat)); | ||
| } | ||
| ComBuffer::ComBuffer(const U8* args, FwSizeType size) { | ||
| SerializeStatus stat = SerializeBufferBase::setBuff(args, size); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return *this; | ||
| } | ||
| ComBuffer::ComBuffer(const ComBuffer& other) : Fw::SerializeBufferBase() { | ||
| SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData, other.getBuffLength()); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return buffer.serialize(static_cast<FwPacketDescriptorType>(this->m_type)); | ||
| } | ||
| SerializeStatus ComPacket::serializeBase(SerializeBufferBase& buffer) const { | ||
| return buffer.serialize(static_cast<FwPacketDescriptorType>(this->m_type)); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| return stat; | ||
| SerializeStatus ComPacket::deserializeBase(SerializeBufferBase& buffer) { | ||
| FwPacketDescriptorType serVal; | ||
| SerializeStatus stat = buffer.deserialize(serVal); |
Check warning
Code scanning / CodeQL
Unchecked function argument Warning
| m_context(src.m_context) | ||
| { | ||
| if(src.m_bufferData != nullptr){ | ||
| Buffer::Buffer() : Serializable(), m_serialize_repr(), m_bufferData(nullptr), m_size(0), m_context(0xFFFFFFFF) {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
|
|
||
| CmdArgBuffer::CmdArgBuffer() { | ||
| } | ||
| CmdArgBuffer::CmdArgBuffer() {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
|
|
||
| CmdArgBuffer::~CmdArgBuffer() { | ||
| } | ||
| CmdArgBuffer::~CmdArgBuffer() {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
| } | ||
|
|
||
| SerializeStatus CmdPacket::serialize(SerializeBufferBase& buffer) const { | ||
| CmdPacket::~CmdPacket() {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
| return FW_SERIALIZE_OK; // for compiler | ||
| } | ||
|
|
||
| SerializeStatus CmdPacket::deserialize(SerializeBufferBase& buffer) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
|
|
||
| ComBuffer::ComBuffer() { | ||
| } | ||
| ComBuffer::ComBuffer() {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
|
|
||
| ComBuffer::~ComBuffer() { | ||
| } | ||
| ComBuffer::~ComBuffer() {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
|
|
||
| ComPacket::ComPacket() : m_type(ComPacketType::FW_PACKET_UNKNOWN) { | ||
| } | ||
| ComPacket::ComPacket() : m_type(ComPacketType::FW_PACKET_UNKNOWN) {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
|
|
||
| ComPacket::~ComPacket() { | ||
| } | ||
| ComPacket::~ComPacket() {} |
Check notice
Code scanning / CodeQL
More than one statement per line Note
| #if FW_SERIALIZABLE_TO_STRING | ||
| void Buffer::toString(Fw::StringBase& text) const { | ||
| static const char * formatString = "(data = %p, size = %u, context = %u)"; | ||
| static const char* formatString = "(data = %p, size = %u, context = %u)"; |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
| } | ||
| CmdArgBuffer::CmdArgBuffer(const CmdArgBuffer& other) : Fw::SerializeBufferBase() { | ||
| SerializeStatus stat = this->setBuff(other.m_bufferData, other.getBuffLength()); | ||
| FW_ASSERT(FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat)); |
Check warning
Code scanning / CppCheck
Member variable 'CmdArgBuffer::m_bufferData' is not assigned in the copy constructor. Should it be copied? Warning
| } | ||
| ComBuffer::ComBuffer(const ComBuffer& other) : Fw::SerializeBufferBase() { | ||
| SerializeStatus stat = SerializeBufferBase::setBuff(other.m_bufferData, other.getBuffLength()); | ||
| FW_ASSERT(FW_SERIALIZE_OK == stat, static_cast<FwAssertArgType>(stat)); |
Check warning
Code scanning / CppCheck
Member variable 'ComBuffer::m_bufferData' is not assigned in the copy constructor. Should it be copied? Warning
|
Ouch - looks like there's no pre-built version of https://pypi.org/project/clang-format/ for ARM (32bit). So our checks running RPI 32bit are slowed down because pip will try to build from source... EDIT: fixed by requiring clang-format only when not on ARM32. ARM32 systems can install through other means, and most likely development (code formatting) is not happening on ARM32 anyways. |
Other Changes
|
Change Description
Adds code formatting check to CI
This only checks a few directories for now. The plan will be to walk through the repo a few directories at a time in multiple PRs, to make reviewing easier.
Fix #3474
Step towards #1984