Skip to content

Commit

Permalink
Reformat pass 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Jan 28, 2024
1 parent de63e10 commit 7218d6b
Show file tree
Hide file tree
Showing 953 changed files with 56,226 additions and 57,419 deletions.
26 changes: 13 additions & 13 deletions .github/ISSUE_TEMPLATE/Issue-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
* Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html)
* Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
* If still experiencing the issue, please provide as many details as possible below about your hardware, computer setup and code.
Expand All @@ -24,7 +24,7 @@ body:
description: What development board or other hardware is the chip attached to?
placeholder: ex. DevKitC, plain module on breadboard, etc. If your hardware is custom or unusual, please attach a photo.
validations:
required: true
required: true
- type: textarea
id: other-hw
attributes:
Expand All @@ -50,7 +50,7 @@ body:
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
Expand All @@ -63,11 +63,11 @@ body:
- type: input
id: IDE
attributes:
label: IDE Name
description: What IDE are you using?
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
label: IDE Name
description: What IDE are you using?
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
validations:
required: true
required: true
- type: input
id: os
attributes:
Expand All @@ -85,13 +85,13 @@ body:
validations:
required: true
- type: dropdown
id: PSRAM
id: PSRAM
attributes:
label: PSRAM enabled
description: Is PSRAM enabled?
options:
- 'yes'
- 'no'
- "yes"
- "no"
validations:
required: true
- type: input
Expand All @@ -118,7 +118,7 @@ body:
placeholder: ex. Related part of the code to replicate the issue
render: cpp
validations:
required: true
required: true
- type: textarea
id: Debug
attributes:
Expand All @@ -127,11 +127,11 @@ body:
placeholder: Enable Core debug level - Debug on tools menu of Arduino IDE, then put the serial output here.
render: plain
validations:
required: true
required: true
- type: textarea
id: other-remarks
attributes:
label: Other Steps to Reproduce
label: Other Steps to Reproduce
description: Is there any other information you can think of which will help us reproduce this problem? Any additional info can be added as well.
placeholder: ex. I also tried on other OS, HW...it works correctly on that setup.
- type: checkboxes
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ contact_links:
about: Community channel for questions and help
- name: ESP32 Forum - Arduino
url: https://esp32.com/viewforum.php?f=19
about: Official Forum for questions
about: Official Forum for questions
4 changes: 2 additions & 2 deletions .github/scripts/find_new_boards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ do
addition_line=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f1 )
addition_count=$( echo "${params_array[c+1]}" | cut -d'+' -f2 | cut -d',' -f2 | cut -d' ' -f1 )
addition_end=$(($addition_line+$addition_count))

addition_line=$(($addition_line + 3))
addition_end=$(($addition_end - $deletion_count))

Expand Down Expand Up @@ -87,4 +87,4 @@ then
echo "FQBNS=${json_matrix}" >> $GITHUB_ENV
else
echo "FQBNS=" >> $GITHUB_ENV
fi
fi
1 change: 0 additions & 1 deletion .github/scripts/install-arduino-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ if [ ! -d "$ARDUINO_IDE_PATH" ] || [ ! -f "$ARDUINO_IDE_PATH/arduino-cli" ]; the
mkdir -p "$ARDUINO_IDE_PATH"
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$ARDUINO_IDE_PATH" sh
fi

1 change: 0 additions & 1 deletion .github/scripts/install-arduino-ide.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ if [ ! -d "$ARDUINO_IDE_PATH" ]; then
echo "Arduino IDE Installed in '$ARDUINO_IDE_PATH'"
echo ""
fi

58 changes: 32 additions & 26 deletions .github/scripts/merge_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
import json
import sys


def load_package(filename):
pkg = json.load(open(filename))['packages'][0]
print("Loaded package {0} from {1}".format(pkg['name'], filename), file=sys.stderr)
print("{0} platform(s), {1} tools".format(len(pkg['platforms']), len(pkg['tools'])), file=sys.stderr)
pkg = json.load(open(filename))["packages"][0]
print("Loaded package {0} from {1}".format(pkg["name"], filename), file=sys.stderr)
print("{0} platform(s), {1} tools".format(len(pkg["platforms"]), len(pkg["tools"])), file=sys.stderr)
return pkg


def merge_objects(versions, obj):
for o in obj:
name = o['name'].encode('ascii')
ver = o['version'].encode('ascii')
name = o["name"].encode("ascii")
ver = o["version"].encode("ascii")
if not name in versions:
print("found new object, {0}".format(name), file=sys.stderr)
versions[name] = {}
Expand All @@ -28,22 +30,23 @@ def merge_objects(versions, obj):
versions[name][ver] = o
return versions


# Normalize ESP release version string (x.x.x) by adding '-rc<MAXINT>' (x.x.x-rc9223372036854775807) to ensure having REL above any RC
# Dummy approach, functional anyway for current ESP package versioning (unlike NormalizedVersion/LooseVersion/StrictVersion & similar crap)
def pkgVersionNormalized(versionString):

verStr = str(versionString)
verParts = re.split('\.|-rc', verStr, flags=re.IGNORECASE)
verParts = re.split("\.|-rc", verStr, flags=re.IGNORECASE)

if len(verParts) == 3:
if (sys.version_info > (3, 0)): # Python 3
verStr = str(versionString) + '-rc' + str(sys.maxsize)
else: # Python 2
verStr = str(versionString) + '-rc' + str(sys.maxint)
if sys.version_info > (3, 0): # Python 3
verStr = str(versionString) + "-rc" + str(sys.maxsize)
else: # Python 2
verStr = str(versionString) + "-rc" + str(sys.maxint)

elif len(verParts) != 4:
print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr)

return verStr


Expand All @@ -53,30 +56,33 @@ def main(args):
return 1

tools = {}
platforms = {}
platforms = {}
pkg1 = load_package(args[1])
tools = merge_objects(tools, pkg1['tools']);
platforms = merge_objects(platforms, pkg1['platforms']);
tools = merge_objects(tools, pkg1["tools"])
platforms = merge_objects(platforms, pkg1["platforms"])
pkg2 = load_package(args[2])
tools = merge_objects(tools, pkg2['tools']);
platforms = merge_objects(platforms, pkg2['platforms']);
tools = merge_objects(tools, pkg2["tools"])
platforms = merge_objects(platforms, pkg2["platforms"])

pkg1['tools'] = []
pkg1['platforms'] = []
pkg1["tools"] = []
pkg1["platforms"] = []

for name in tools:
for version in tools[name]:
print("Adding tool {0}-{1}".format(name, version), file=sys.stderr)
pkg1['tools'].append(tools[name][version])
pkg1["tools"].append(tools[name][version])

for name in platforms:
for version in platforms[name]:
print("Adding platform {0}-{1}".format(name, version), file=sys.stderr)
pkg1['platforms'].append(platforms[name][version])

pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
pkg1["platforms"].append(platforms[name][version])

pkg1["platforms"] = sorted(
pkg1["platforms"], key=lambda k: LooseVersion(pkgVersionNormalized(k["version"])), reverse=True
)

json.dump({"packages": [pkg1]}, sys.stdout, indent=2)

json.dump({'packages':[pkg1]}, sys.stdout, indent=2)

if __name__ == '__main__':
if __name__ == "__main__":
sys.exit(main(sys.argv))
5 changes: 2 additions & 3 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
echo "Skipping $sketchname for target $target"
exit 0
fi

ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
if [ -n "$ARDUINO_BUILD_DIR" ]; then
build_dir="$ARDUINO_BUILD_DIR"
Expand Down Expand Up @@ -164,7 +164,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
--build-cache-path "$ARDUINO_CACHE_DIR" \
--build-path "$build_dir" \
$xtra_opts "${sketchdir}"

exit_status=$?
if [ $exit_status -ne 0 ]; then
echo ""ERROR: Compilation failed with error code $exit_status""
Expand Down Expand Up @@ -388,4 +388,3 @@ case "$cmd" in
echo "$USAGE"
exit 2
esac

1 change: 0 additions & 1 deletion .github/scripts/tests_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ else
fi

${BUILD_CMD} ${args} $*

16 changes: 6 additions & 10 deletions .github/workflows/allboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
ref: ${{ github.event.client_payload.branch }}

- name: Get boards fqbns
run:
bash .github/scripts/find_all_boards.sh
run: bash .github/scripts/find_all_boards.sh

setup-chunks:
needs: find-boards
Expand All @@ -43,8 +42,7 @@ jobs:

- id: set-test-chunks
name: Set Chunks
run:
echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
run: echo "test-chunks<<EOF" >> $GITHUB_OUTPUT

echo "$( jq -nc '${{ needs.find-boards.outputs.fqbns }} | [_nwise( ${{ needs.find-boards.outputs.board-count }}/15 | ceil)]')" >> $GITHUB_OUTPUT

Expand All @@ -61,7 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
matrix:
chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }}

steps:
Expand All @@ -71,9 +69,8 @@ jobs:
ref: ${{ github.event.client_payload.branch }}

- name: Echo FQBNS to file
run:
echo "$FQBN" > fqbns.json
env:
run: echo "$FQBN" > fqbns.json
env:
FQBN: ${{ toJSON(matrix.chunk) }}

- name: Compile sketch
Expand All @@ -88,5 +85,4 @@ jobs:
enable-warnings-report: false
cli-compile-flags: |
- --warnings="all"
sketch-paths:
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
sketch-paths: "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
6 changes: 2 additions & 4 deletions .github/workflows/boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
uses: dcarbone/install-jq-action@v1.0.1

- name: Get board name
run:
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.event.number}}
run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.event.number}}

test-boards:
needs: find-boards
Expand Down Expand Up @@ -67,5 +66,4 @@ jobs:
cli-compile-flags: |
- --warnings="all"
exit-on-fail: true
sketch-paths:
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
sketch-paths: "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
48 changes: 24 additions & 24 deletions .github/workflows/build_py_tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Build Python Tools
on:
pull_request:
paths:
- 'tools/get.py'
- 'tools/espota.py'
- 'tools/gen_esp32part.py'
- 'tools/gen_insights_package.py'
- "tools/get.py"
- "tools/espota.py"
- "tools/gen_esp32part.py"
- "tools/gen_insights_package.py"

jobs:
find-changed-tools:
Expand All @@ -25,8 +25,8 @@ jobs:
uses: tj-actions/changed-files@v41
id: verify-changed-files
with:
fetch_depth: '2'
since_last_remote_commit: 'true'
fetch_depth: "2"
since_last_remote_commit: "true"
files: |
tools/get.py
tools/espota.py
Expand All @@ -49,24 +49,24 @@ jobs:
matrix:
os: [windows-latest, macos-latest, ubuntu-20.04, ARM, ARM64]
include:
- os: windows-latest
TARGET: win64
EXTEN: .exe
SEPARATOR: ';'
- os: macos-latest
TARGET: macos
SEPARATOR: ':'
- os: ubuntu-20.04
TARGET: linux-amd64
SEPARATOR: ':'
- os: ARM
CONTAINER: python:3.8-bullseye
TARGET: arm
SEPARATOR: ':'
- os: ARM64
CONTAINER: python:3.8-bullseye
TARGET: arm64
SEPARATOR: ':'
- os: windows-latest
TARGET: win64
EXTEN: .exe
SEPARATOR: ";"
- os: macos-latest
TARGET: macos
SEPARATOR: ":"
- os: ubuntu-20.04
TARGET: linux-amd64
SEPARATOR: ":"
- os: ARM
CONTAINER: python:3.8-bullseye
TARGET: arm
SEPARATOR: ":"
- os: ARM64
CONTAINER: python:3.8-bullseye
TARGET: arm64
SEPARATOR: ":"
container: ${{ matrix.CONTAINER }} # use python container on ARM
env:
DISTPATH: pytools-${{ matrix.TARGET }}
Expand Down
Loading

0 comments on commit 7218d6b

Please sign in to comment.