Skip to content

Commit

Permalink
Added check tools
Browse files Browse the repository at this point in the history
  • Loading branch information
qfisch committed Feb 5, 2025
1 parent 064d94b commit 285df2c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
1 change: 0 additions & 1 deletion .cppcheck_suppressions.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
unusedStructMember:src/event_source.h
2 changes: 1 addition & 1 deletion .github/workflows/arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Arduino Library
on:
pull_request:
branches:
- master
- main

jobs:
Arduino-Checks:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/platformio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: PlatformIO Library
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
tags:
- "[0-9]+.[0-9]+.[0-9]+"

Expand All @@ -16,11 +16,11 @@ jobs:
with:
pio-environment-list: '["selfManagedWifiUsage", "delegatedWifiUsage"]'

PilatformIO-Build:
PlatformIO-Build:
uses: sensirion/.github/.github/workflows/upt.platformio.build.yml@main
needs: PlatformIO-Check
with:
pio-environment-list: '["selfManagedWifUsage", "delegatedWifiUsage"]'
pio-environment-list: '["selfManagedWifiUsage", "delegatedWifiUsage"]'

PlatformIO-Package:
if: ${{ (github.ref_type != 'tag') && (github.ref_name == 'master') }}
Expand Down
8 changes: 8 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ lib_deps =
sensirion/Sensirion UPT Core@^0.5.1
lib_extra_dirs =
${PROJECT_DIR}/src/*
check_tool = cppcheck, clangtidy
check_skip_packages = yes
check_flags=
clangtidy: --style=file
cppcheck: --suppress=unusedFunction
check_src_filters =
+<${PROJECT_DIR}/src/>
+<${PROJECT_DIR}/examples/>

[env:selfManagedWifiUsage]
build_src_filter = +<*> -<.git/> -<.svn/> +<${common.selfManagedWifiUsage_srcdir}>
Expand Down
13 changes: 12 additions & 1 deletion py_scripts/make_cpp_files.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import os
import shutil

ARDUINO_FILE_EXTENSION = ".ino"
TARGET_FILE_EXTENSION = ".cpp"
EXAMPLE_FOLDER = "examples"

# Create a .cpp file for all the .ino files in the examples dir (CAUTION: will overwrite existing)
print("PRE_SCRIPT: Copying .ino file contents to .cpp files.")
os.system(f'find examples -type f -name "*.ino" -exec bash -c \'for file; do cp "$file" "$(dirname "$file")/$(basename "$file" .ino).cpp"; done\' _ {{}} +')
for e in os.listdir(EXAMPLE_FOLDER):
if os.path.isdir(f"{EXAMPLE_FOLDER}/{e}") and os.path.isfile(f"{EXAMPLE_FOLDER}/{e}/{e}{ARDUINO_FILE_EXTENSION}"):
arduino_file =f"{EXAMPLE_FOLDER}/{e}/{e}{ARDUINO_FILE_EXTENSION}"
cpp_file = f"{EXAMPLE_FOLDER}/{e}/{e}{TARGET_FILE_EXTENSION}"
shutil.copyfile(arduino_file, cpp_file)
print(f'\tcopied {arduino_file} to {cpp_file}')
print("\t>> Done.")

0 comments on commit 285df2c

Please sign in to comment.