Prepere repo so we can run auto formatters (#747)

* clang-format: Ignore javascript files

Ignore javascript files. Clang-format is not very good formatter for
javascript files anyway. If we ever need javascript formatter we should
use Prettier.

* clang-format: Ignore some lines in sources

Couple things get formatted really funky if we let clang-format format
those. Just ignore those locally.

* zephyr/tescase.yaml: Fix yaml syntax

pre-commit hook check-yaml did found out that there are two skips.
Remove another as this is not right syntax.

* Fix repo contains unicode replacement chars

When running pre-commit text-unicode-replacement-char it founds that
there is couple unicode replacemnt chars. Remove and replace these.

* Convert some tabs to spaces manually

We will soon auto format tabs to spaces. How ever it could not do couple
thing so fix those by hand first.

* Make files with shebang executables

It is good habit that if file has shebang then it is marked executable.
These where found with pre-commit check-shebang-scripts-are-executable
checker.

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
Kari Argillander
2024-08-24 01:58:41 +03:00
committed by GitHub
parent 36b5a3be98
commit 9e0657424e
26 changed files with 84 additions and 77 deletions
+3
View File
@@ -18,4 +18,7 @@ IndentWidth: 4
UseTab: Never UseTab: Never
SortIncludes: false SortIncludes: false
ColumnLimit: 80 ColumnLimit: 80
---
Language: JavaScript
DisableFormat: true
... ...
+1 -1
View File
@@ -39,7 +39,7 @@ option(
"compile the bacpoll app" "compile the bacpoll app"
ON) ON)
option( option(
BACNET_BUILD_BACDISCOVER_APP BACNET_BUILD_BACDISCOVER_APP
"compile the bacdiscover app" "compile the bacdiscover app"
ON) ON)
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
View File
+3 -3
View File
@@ -22,9 +22,9 @@ enum INT_STATE { INT_DISABLED, INT_ENABLED, INT_RESTORE };
#define RESTART_WDT() { _asm CLRWDT _endasm } #define RESTART_WDT() { _asm CLRWDT _endasm }
/* ************************************************************************* /* *************************************************************************
define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1 define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1
#define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0 #define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0
#define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1 #define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1
#define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0 #define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0
*************************************************************************** */ *************************************************************************** */
#define ENABLE_HIGH_INT() INTCONbits.GIE = 1 #define ENABLE_HIGH_INT() INTCONbits.GIE = 1
View File
+3 -3
View File
@@ -45,9 +45,9 @@ enum INT_STATE { INT_DISABLED, INT_ENABLED, INT_RESTORE };
#define RESTART_WDT() { _asm CLRWDT _endasm } #define RESTART_WDT() { _asm CLRWDT _endasm }
/* ************************************************************************* /* *************************************************************************
define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1 define ENABLE_GLOBAL_INT() INTCONbits.GIE = 1
#define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0 #define DISABLE_GLOBAL_INT() INTCONbits.GIE = 0
#define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1 #define ENABLE_PERIPHERAL_INT() INTCONbits.PEIE = 1
#define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0 #define DISABLE_PERIPHERAL_INT() INTCONbits.PEIE = 0
*************************************************************************** */ *************************************************************************** */
#define ENABLE_HIGH_INT() INTCONbits.GIE = 1 #define ENABLE_HIGH_INT() INTCONbits.GIE = 1
+2
View File
@@ -19,12 +19,14 @@
* @{ * @{
*/ */
#ifndef NEXT_POWER_OF_2 #ifndef NEXT_POWER_OF_2
/* clang-format off */
#define B2(x) ( (x) | ( (x) >> 1) ) #define B2(x) ( (x) | ( (x) >> 1) )
#define B4(x) ( B2(x) | ( B2(x) >> 2) ) #define B4(x) ( B2(x) | ( B2(x) >> 2) )
#define B8(x) ( B4(x) | ( B4(x) >> 4) ) #define B8(x) ( B4(x) | ( B4(x) >> 4) )
#define B16(x) ( B8(x) | ( B8(x) >> 8) ) #define B16(x) ( B8(x) | ( B8(x) >> 8) )
#define B32(x) (B16(x) | (B16(x) >>16) ) #define B32(x) (B16(x) | (B16(x) >>16) )
#define NEXT_POWER_OF_2(x) (B32((x)-1) + 1) #define NEXT_POWER_OF_2(x) (B32((x)-1) + 1)
/* clang-format on */
#endif #endif
/** @} */ /** @} */
+6 -1
View File
@@ -130,7 +130,9 @@
/* BACAPP decodes WriteProperty service requests /* BACAPP decodes WriteProperty service requests
Choose the datatypes that your application supports */ Choose the datatypes that your application supports */
#if !(defined(BACAPP_ALL) || \ /* clang-format off */
#if !( \
defined(BACAPP_ALL) || \
defined(BACAPP_MINIMAL) || \ defined(BACAPP_MINIMAL) || \
defined(BACAPP_NULL) || \ defined(BACAPP_NULL) || \
defined(BACAPP_BOOLEAN) || \ defined(BACAPP_BOOLEAN) || \
@@ -166,6 +168,7 @@
defined(BACAPP_TYPES_EXTRA)) defined(BACAPP_TYPES_EXTRA))
#define BACAPP_ALL #define BACAPP_ALL
#endif #endif
/* clang-format on */
#if defined (BACAPP_ALL) #if defined (BACAPP_ALL)
#define BACAPP_MINIMAL #define BACAPP_MINIMAL
@@ -210,6 +213,7 @@
#define BACAPP_SHED_LEVEL #define BACAPP_SHED_LEVEL
#endif #endif
/* clang-format off */
#if defined(BACAPP_DOUBLE) || \ #if defined(BACAPP_DOUBLE) || \
defined(BACAPP_DATETIME) || \ defined(BACAPP_DATETIME) || \
defined(BACAPP_DATERANGE) || \ defined(BACAPP_DATERANGE) || \
@@ -231,6 +235,7 @@
defined(BACAPP_SHED_LEVEL) defined(BACAPP_SHED_LEVEL)
#define BACAPP_COMPLEX_TYPES #define BACAPP_COMPLEX_TYPES
#endif #endif
/* clang-format on */
/* /*
** Set the maximum vector type sizes ** Set the maximum vector type sizes
+3 -3
View File
@@ -1465,9 +1465,9 @@ int bvlc6_decode_secure_bvll(uint8_t *pdu,
* *
* This message provides a mechanism whereby a foreign device * This message provides a mechanism whereby a foreign device
* shall cause a BBMD to distribute a Forwarded-NPDU * shall cause a BBMD to distribute a Forwarded-NPDU
* BVLC to the local multicast domain, to all BBMDs configured * BVLC to the local multicast domain, to all BBMD's configured
* in the BBMDs BDT, and to all foreign devices in the * in the BBMD's BDT, and to all foreign devices in the
* BBMDs FDT. * BBMD's FDT.
* *
* @param pdu - buffer to store the encoding * @param pdu - buffer to store the encoding
* @param pdu_size - size of the buffer to store encoding * @param pdu_size - size of the buffer to store encoding
+1 -1
View File
@@ -393,7 +393,7 @@ int rr_decode_service_request(
* ReadRange-ACK ::= SEQUENCE { * ReadRange-ACK ::= SEQUENCE {
* objectIdentifier [0] BACnetObjectIdentifier, * objectIdentifier [0] BACnetObjectIdentifier,
* propertyIdentifier [1] BACnetPropertyIdentifier, * propertyIdentifier [1] BACnetPropertyIdentifier,
* propertyArrayIndex [2] Unsigned OPTIONAL , -- used only with * propertyArrayIndex [2] Unsigned OPTIONAL, -- used only with
* array datatype resultFlags [3] BACnetResultFlags, itemCount [4] * array datatype resultFlags [3] BACnetResultFlags, itemCount [4]
* Unsigned, itemData [5] SEQUENCE OF ABSTRACT-SYNTAX.&TYPE, * Unsigned, itemData [5] SEQUENCE OF ABSTRACT-SYNTAX.&TYPE,
* firstSequenceNumber [6] Unsigned32 OPTIONAL -- used only if 'Item * firstSequenceNumber [6] Unsigned32 OPTIONAL -- used only if 'Item
-2
View File
@@ -22,5 +22,3 @@ config BACNET_SHELL
select LOG select LOG
help help
Enable BACnet Shell support Enable BACnet Shell support
@@ -1,6 +1,5 @@
common: common:
skip: true # TODO: Remove skip when zephyr v3.0.0 nested <time.h> conflicting definitions resolved. skip: true # TODO: Remove skip when zephyr v3.0.0 nested <time.h> conflicting definitions resolved.
skip: true #TODO: debug test for Zephyr v3.2.0
tests: tests:
bacnet.datalink.bvlc.unit: bacnet.datalink.bvlc.unit:
tags: bacnet tags: bacnet