diff --git a/.clang-format b/.clang-format index c3ce2e57..a92920cb 100644 --- a/.clang-format +++ b/.clang-format @@ -97,3 +97,4 @@ SpacesInSquareBrackets: false Standard: Cpp11 TabWidth: 2 UseTab: ForIndentation +InsertNewlineAtEOF: true diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index edd43590..315eb9c8 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -8,8 +8,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.10.1 + uses: jidicula/clang-format-action@v4.11.0 with: + clang-format-version: 16 # Some files can be excluded from the clang-format style check, like 3rd party driver files, # as their licenses may not allow us to modify them, such as if they are LGPL licensed. # The exclude-regex option can be used to exclude these files from the style check: diff --git a/examples/guidance/console_logger.cpp b/examples/guidance/console_logger.cpp index 5940f2a9..2eb71263 100644 --- a/examples/guidance/console_logger.cpp +++ b/examples/guidance/console_logger.cpp @@ -64,4 +64,4 @@ class CustomLogger : public isobus::CANStackLogger } }; -static CustomLogger logger; \ No newline at end of file +static CustomLogger logger; diff --git a/examples/virtual_terminal/aux_functions/console_logger.cpp b/examples/virtual_terminal/aux_functions/console_logger.cpp index 5940f2a9..2eb71263 100644 --- a/examples/virtual_terminal/aux_functions/console_logger.cpp +++ b/examples/virtual_terminal/aux_functions/console_logger.cpp @@ -64,4 +64,4 @@ class CustomLogger : public isobus::CANStackLogger } }; -static CustomLogger logger; \ No newline at end of file +static CustomLogger logger; diff --git a/examples/virtual_terminal/aux_inputs/console_logger.cpp b/examples/virtual_terminal/aux_inputs/console_logger.cpp index 5940f2a9..2eb71263 100644 --- a/examples/virtual_terminal/aux_inputs/console_logger.cpp +++ b/examples/virtual_terminal/aux_inputs/console_logger.cpp @@ -64,4 +64,4 @@ class CustomLogger : public isobus::CANStackLogger } }; -static CustomLogger logger; \ No newline at end of file +static CustomLogger logger; diff --git a/examples/virtual_terminal/esp32_platformio_object_pool/src/console_logger.cpp b/examples/virtual_terminal/esp32_platformio_object_pool/src/console_logger.cpp index d1bccbe2..e39cefd4 100644 --- a/examples/virtual_terminal/esp32_platformio_object_pool/src/console_logger.cpp +++ b/examples/virtual_terminal/esp32_platformio_object_pool/src/console_logger.cpp @@ -76,4 +76,4 @@ class CustomLogger : public isobus::CANStackLogger } }; -static CustomLogger logger; \ No newline at end of file +static CustomLogger logger; diff --git a/examples/virtual_terminal/version3_object_pool/console_logger.cpp b/examples/virtual_terminal/version3_object_pool/console_logger.cpp index 5940f2a9..2eb71263 100644 --- a/examples/virtual_terminal/version3_object_pool/console_logger.cpp +++ b/examples/virtual_terminal/version3_object_pool/console_logger.cpp @@ -64,4 +64,4 @@ class CustomLogger : public isobus::CANStackLogger } }; -static CustomLogger logger; \ No newline at end of file +static CustomLogger logger; diff --git a/hardware_integration/include/isobus/hardware_integration/available_can_drivers.hpp b/hardware_integration/include/isobus/hardware_integration/available_can_drivers.hpp index 6b696d70..8a9042dd 100644 --- a/hardware_integration/include/isobus/hardware_integration/available_can_drivers.hpp +++ b/hardware_integration/include/isobus/hardware_integration/available_can_drivers.hpp @@ -46,4 +46,4 @@ #include "isobus/hardware_integration/sys_tec_windows_plugin.hpp" #endif -#endif // AVAILABLE_CAN_DRIVERS_HPP \ No newline at end of file +#endif // AVAILABLE_CAN_DRIVERS_HPP diff --git a/hardware_integration/include/isobus/hardware_integration/socket_can_interface.hpp b/hardware_integration/include/isobus/hardware_integration/socket_can_interface.hpp index 4d5244bb..ade841d1 100644 --- a/hardware_integration/include/isobus/hardware_integration/socket_can_interface.hpp +++ b/hardware_integration/include/isobus/hardware_integration/socket_can_interface.hpp @@ -70,4 +70,4 @@ namespace isobus int fileDescriptor; ///< File descriptor for the socket }; } -#endif // SOCKET_CAN_INTERFACE_HPP \ No newline at end of file +#endif // SOCKET_CAN_INTERFACE_HPP diff --git a/hardware_integration/include/isobus/hardware_integration/spi_transaction_frame.hpp b/hardware_integration/include/isobus/hardware_integration/spi_transaction_frame.hpp index c95604b9..c87cbb9c 100644 --- a/hardware_integration/include/isobus/hardware_integration/spi_transaction_frame.hpp +++ b/hardware_integration/include/isobus/hardware_integration/spi_transaction_frame.hpp @@ -61,4 +61,4 @@ namespace isobus std::vector rxBuffer; ///< The buffer to store the response in }; } -#endif // SPI_TRANSACTION_FRAME_HPP \ No newline at end of file +#endif // SPI_TRANSACTION_FRAME_HPP diff --git a/hardware_integration/include/isobus/hardware_integration/virtual_can_plugin.hpp b/hardware_integration/include/isobus/hardware_integration/virtual_can_plugin.hpp index 6b049f62..b3b87645 100644 --- a/hardware_integration/include/isobus/hardware_integration/virtual_can_plugin.hpp +++ b/hardware_integration/include/isobus/hardware_integration/virtual_can_plugin.hpp @@ -104,4 +104,4 @@ namespace isobus std::atomic_bool running; ///< If `true`, the driver is running }; } -#endif // VIRTUAL_CAN_PLUGIN_HPP \ No newline at end of file +#endif // VIRTUAL_CAN_PLUGIN_HPP diff --git a/hardware_integration/src/can_hardware_interface.cpp b/hardware_integration/src/can_hardware_interface.cpp index 9661f783..798dac4c 100644 --- a/hardware_integration/src/can_hardware_interface.cpp +++ b/hardware_integration/src/can_hardware_interface.cpp @@ -410,4 +410,4 @@ namespace isobus } }); } -} \ No newline at end of file +} diff --git a/hardware_integration/src/can_hardware_interface_single_thread.cpp b/hardware_integration/src/can_hardware_interface_single_thread.cpp index 942fd04f..1a364f48 100644 --- a/hardware_integration/src/can_hardware_interface_single_thread.cpp +++ b/hardware_integration/src/can_hardware_interface_single_thread.cpp @@ -263,4 +263,4 @@ namespace isobus } return retVal; } -} // namespace isobus \ No newline at end of file +} // namespace isobus diff --git a/hardware_integration/src/spi_transaction_frame.cpp b/hardware_integration/src/spi_transaction_frame.cpp index 3957dc68..9aed7135 100644 --- a/hardware_integration/src/spi_transaction_frame.cpp +++ b/hardware_integration/src/spi_transaction_frame.cpp @@ -84,4 +84,4 @@ namespace isobus { return read; } -} \ No newline at end of file +} diff --git a/isobus/include/isobus/isobus/isobus_guidance_interface.hpp b/isobus/include/isobus/isobus/isobus_guidance_interface.hpp index b98ea134..82f3396c 100644 --- a/isobus/include/isobus/isobus/isobus_guidance_interface.hpp +++ b/isobus/include/isobus/isobus/isobus_guidance_interface.hpp @@ -405,4 +405,4 @@ namespace isobus }; } // namespace isobus -#endif // ISOBUS_GUIDANCE_HPP \ No newline at end of file +#endif // ISOBUS_GUIDANCE_HPP diff --git a/isobus/src/can_NAME_filter.cpp b/isobus/src/can_NAME_filter.cpp index 28bf0bfa..64dd610d 100644 --- a/isobus/src/can_NAME_filter.cpp +++ b/isobus/src/can_NAME_filter.cpp @@ -95,4 +95,4 @@ namespace isobus return retVal; } -} // namespace isobus \ No newline at end of file +} // namespace isobus diff --git a/test/can_name_tests.cpp b/test/can_name_tests.cpp index 09be7e76..53e30421 100644 --- a/test/can_name_tests.cpp +++ b/test/can_name_tests.cpp @@ -105,4 +105,4 @@ TEST(CAN_NAME_TESTS, FilterMatches) NAMEFilter filterArbitraryAddressCapable(NAME::NAMEParameters::ArbitraryAddressCapable, true); TestDeviceNAME.set_arbitrary_address_capable(true); EXPECT_TRUE(filterArbitraryAddressCapable.check_name_matches_filter(TestDeviceNAME)); -} \ No newline at end of file +} diff --git a/test/event_dispatcher_tests.cpp b/test/event_dispatcher_tests.cpp index df775808..bdfeae76 100644 --- a/test/event_dispatcher_tests.cpp +++ b/test/event_dispatcher_tests.cpp @@ -145,4 +145,4 @@ TEST(EVENT_DISPATCHER_TESTS, CallEvent) dispatcher.call(lvalue); ASSERT_EQ(count, 2); -} \ No newline at end of file +} diff --git a/test/helpers/messaging_helpers.cpp b/test/helpers/messaging_helpers.cpp index 7575ce93..ee1d0af6 100644 --- a/test/helpers/messaging_helpers.cpp +++ b/test/helpers/messaging_helpers.cpp @@ -168,4 +168,4 @@ namespace test_helpers }); } -} // namespace test_helpers \ No newline at end of file +} // namespace test_helpers diff --git a/test/identifier_tests.cpp b/test/identifier_tests.cpp index a48e3049..e642e4e9 100644 --- a/test/identifier_tests.cpp +++ b/test/identifier_tests.cpp @@ -16,4 +16,4 @@ TEST(IDENTIFIER_TESTS, RawIdentifierConstuction) EXPECT_EQ(0xEF00, testID.get_parameter_group_number()); EXPECT_EQ(0x1C, testID.get_destination_address()); EXPECT_EQ(0x80, testID.get_source_address()); -} \ No newline at end of file +} diff --git a/test/transport_protocol_tests.cpp b/test/transport_protocol_tests.cpp index f74da19f..78beb1a6 100644 --- a/test/transport_protocol_tests.cpp +++ b/test/transport_protocol_tests.cpp @@ -2138,4 +2138,4 @@ TEST(TRANSPORT_PROTOCOL_TESTS, DestinationSpecificOverwriteSession) // After the transmission is finished, the sessions should be removed as indication that connection is closed ASSERT_FALSE(manager.has_session(originator, receiver)); -} \ No newline at end of file +}