Skip to content

Commit 76d1f9e

Browse files
authored
ci(pre-commit): Bump hooks versions and fix leftover files (espressif#10680)
* update(hooks): Bump pre-commit hooks versions * fix(formatting): Fix python script formatting * fix(formatting): Fix leftover files on protected folders
1 parent 92dd841 commit 76d1f9e

28 files changed

+363
-353
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ body:
55
- type: markdown
66
attributes:
77
value: |
8-
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
8+
* Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue)
99
* Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html)
1010
* Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html)
1111
* If still experiencing the issue, please provide as many details as possible below about your hardware, computer setup and code.
@@ -24,7 +24,7 @@ body:
2424
description: What development board or other hardware is the chip attached to?
2525
placeholder: ex. DevKitC, plain module on breadboard, etc. If your hardware is custom or unusual, please attach a photo.
2626
validations:
27-
required: true
27+
required: true
2828
- type: textarea
2929
id: other-hw
3030
attributes:
@@ -60,7 +60,7 @@ body:
6060
- v2.0.8
6161
- v2.0.7
6262
- v2.0.6
63-
- v2.0.5
63+
- v2.0.5
6464
- v2.0.4
6565
- v2.0.3
6666
- v2.0.2
@@ -77,7 +77,7 @@ body:
7777
description: What IDE are you using?
7878
placeholder: eg. Arduino IDE, PlatformIO, Sloeber...
7979
validations:
80-
required: true
80+
required: true
8181
- type: input
8282
id: os
8383
attributes:
@@ -95,13 +95,13 @@ body:
9595
validations:
9696
required: true
9797
- type: dropdown
98-
id: PSRAM
98+
id: PSRAM
9999
attributes:
100100
label: PSRAM enabled
101101
description: Is PSRAM enabled?
102102
options:
103-
- 'yes'
104-
- 'no'
103+
- "yes"
104+
- "no"
105105
validations:
106106
required: true
107107
- type: input
@@ -116,8 +116,8 @@ body:
116116
id: Description
117117
attributes:
118118
label: Description
119-
description: Please describe your problem here and expected behaviour
120-
placeholder: ex. Can't connect/weird behaviour/wrong function/missing parameter..
119+
description: Please describe your problem here and expected behavior
120+
placeholder: ex. Can't connect/weird behavior/wrong function/missing parameter..
121121
validations:
122122
required: true
123123
- type: textarea
@@ -128,7 +128,7 @@ body:
128128
placeholder: ex. Related part of the code to replicate the issue
129129
render: cpp
130130
validations:
131-
required: true
131+
required: true
132132
- type: textarea
133133
id: Debug
134134
attributes:
@@ -137,11 +137,11 @@ body:
137137
placeholder: Enable Core debug level - Debug on tools menu of Arduino IDE, then put the serial output here.
138138
render: plain
139139
validations:
140-
required: true
140+
required: true
141141
- type: textarea
142142
id: other-remarks
143143
attributes:
144-
label: Other Steps to Reproduce
144+
label: Other Steps to Reproduce
145145
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.
146146
placeholder: ex. I also tried on other OS, HW...it works correctly on that setup.
147147
- type: checkboxes

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ contact_links:
55
about: Community channel for questions and help
66
- name: ESP32 Forum - Arduino
77
url: https://esp32.com/viewforum.php?f=19
8-
about: Official Forum for questions
8+
about: Official Forum for questions

.github/scripts/merge_packages.py

+46-32
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,58 @@
11
#!/usr/bin/env python
2+
23
# This script merges two Arduino Board Manager package json files.
34
# Usage:
45
# python merge_packages.py package_esp8266com_index.json version/new/package_esp8266com_index.json
56
# Written by Ivan Grokhotkov, 2015
67
#
8+
79
from __future__ import print_function
8-
#from distutils.version import LooseVersion
10+
11+
# from distutils.version import LooseVersion
912
from packaging.version import Version
1013
import re
1114
import json
1215
import sys
1316

17+
1418
def load_package(filename):
15-
pkg = json.load(open(filename))['packages'][0]
16-
print("Loaded package {0} from {1}".format(pkg['name'], filename), file=sys.stderr)
17-
print("{0} platform(s), {1} tools".format(len(pkg['platforms']), len(pkg['tools'])), file=sys.stderr)
19+
pkg = json.load(open(filename))["packages"][0]
20+
print("Loaded package {0} from {1}".format(pkg["name"], filename), file=sys.stderr)
21+
print("{0} platform(s), {1} tools".format(len(pkg["platforms"]), len(pkg["tools"])), file=sys.stderr)
1822
return pkg
1923

24+
2025
def merge_objects(versions, obj):
2126
for o in obj:
22-
name = o['name'].encode('ascii')
23-
ver = o['version'].encode('ascii')
24-
if not name in versions:
27+
name = o["name"].encode("ascii")
28+
ver = o["version"].encode("ascii")
29+
if name not in versions:
2530
print("found new object, {0}".format(name), file=sys.stderr)
2631
versions[name] = {}
27-
if not ver in versions[name]:
32+
if ver not in versions[name]:
2833
print("found new version {0} for object {1}".format(ver, name), file=sys.stderr)
2934
versions[name][ver] = o
3035
return versions
3136

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

3644
verStr = str(versionString)
37-
verParts = re.split('\.|-rc|-alpha', verStr, flags=re.IGNORECASE)
38-
45+
verParts = re.split(r"\.|-rc|-alpha", verStr, flags=re.IGNORECASE)
46+
3947
if len(verParts) == 3:
40-
if (sys.version_info > (3, 0)): # Python 3
41-
verStr = str(versionString) + '-rc' + str(sys.maxsize)
42-
else: # Python 2
43-
verStr = str(versionString) + '-rc' + str(sys.maxint)
44-
48+
if sys.version_info > (3, 0): # Python 3
49+
verStr = str(versionString) + "-rc" + str(sys.maxsize)
50+
else: # Python 2
51+
verStr = str(versionString) + "-rc" + str(sys.maxint)
52+
4553
elif len(verParts) != 4:
4654
print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr)
47-
55+
4856
return verStr
4957

5058

@@ -54,31 +62,37 @@ def main(args):
5462
return 1
5563

5664
tools = {}
57-
platforms = {}
65+
platforms = {}
5866
pkg1 = load_package(args[1])
59-
tools = merge_objects(tools, pkg1['tools']);
60-
platforms = merge_objects(platforms, pkg1['platforms']);
67+
tools = merge_objects(tools, pkg1["tools"])
68+
platforms = merge_objects(platforms, pkg1["platforms"])
6169
pkg2 = load_package(args[2])
62-
tools = merge_objects(tools, pkg2['tools']);
63-
platforms = merge_objects(platforms, pkg2['platforms']);
70+
tools = merge_objects(tools, pkg2["tools"])
71+
platforms = merge_objects(platforms, pkg2["platforms"])
6472

65-
pkg1['tools'] = []
66-
pkg1['platforms'] = []
73+
pkg1["tools"] = []
74+
pkg1["platforms"] = []
6775

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

7381
for name in platforms:
7482
for version in platforms[name]:
7583
print("Adding platform {0}-{1}".format(name, version), file=sys.stderr)
76-
pkg1['platforms'].append(platforms[name][version])
77-
78-
#pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: LooseVersion(pkgVersionNormalized(k['version'])), reverse=True)
79-
pkg1['platforms'] = sorted(pkg1['platforms'], key=lambda k: Version(pkgVersionNormalized(k['version'])), reverse=True)
84+
pkg1["platforms"].append(platforms[name][version])
85+
86+
# pkg1["platforms"] = sorted(
87+
# pkg1["platforms"], key=lambda k: LooseVersion(pkgVersionNormalized(k["version"])), reverse=True
88+
# )
89+
90+
pkg1["platforms"] = sorted(
91+
pkg1["platforms"], key=lambda k: Version(pkgVersionNormalized(k["version"])), reverse=True
92+
)
93+
94+
json.dump({"packages": [pkg1]}, sys.stdout, indent=2)
8095

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

83-
if __name__ == '__main__':
97+
if __name__ == "__main__":
8498
sys.exit(main(sys.argv))

.github/workflows/allboards.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Boards Test - Remote trigger
22

3-
# The workflow will run on remote dispath with event-type set to "test-boards"
3+
# The workflow will run on remote dispatch with event-type set to "test-boards"
44
on:
55
repository_dispatch:
66
types: [test-boards]
@@ -20,8 +20,7 @@ jobs:
2020
ref: ${{ github.event.client_payload.branch }}
2121

2222
- name: Get boards fqbns
23-
run:
24-
bash .github/scripts/find_all_boards.sh
23+
run: bash .github/scripts/find_all_boards.sh
2524

2625
setup-chunks:
2726
needs: find-boards
@@ -43,8 +42,7 @@ jobs:
4342

4443
- id: set-test-chunks
4544
name: Set Chunks
46-
run:
47-
echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
45+
run: echo "test-chunks<<EOF" >> $GITHUB_OUTPUT
4846

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

@@ -61,7 +59,7 @@ jobs:
6159
6260
strategy:
6361
fail-fast: false
64-
matrix:
62+
matrix:
6563
chunk: ${{ fromJSON(needs.setup-chunks.outputs['test-chunks']) }}
6664

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

7371
- name: Echo FQBNS to file
74-
run:
75-
echo "$FQBN" > fqbns.json
76-
env:
72+
run: echo "$FQBN" > fqbns.json
73+
env:
7774
FQBN: ${{ toJSON(matrix.chunk) }}
7875

7976
- name: Compile sketch
@@ -88,5 +85,4 @@ jobs:
8885
enable-warnings-report: false
8986
cli-compile-flags: |
9087
- --warnings="all"
91-
sketch-paths:
92-
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
88+
sketch-paths: "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"

.github/workflows/boards.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Boards Test
44
on:
55
pull_request:
66
paths:
7-
- 'boards.txt'
8-
- 'libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino'
9-
- '.github/workflows/boards.yml'
7+
- "boards.txt"
8+
- "libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
9+
- ".github/workflows/boards.yml"
1010

1111
env:
1212
# It's convenient to set variables for values used multiple times in the workflow
@@ -28,8 +28,7 @@ jobs:
2828
uses: dcarbone/install-jq-action@v1.0.1
2929

3030
- name: Get board name
31-
run:
32-
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}
31+
run: bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.base_ref}}
3332

3433
test-boards:
3534
needs: find-boards
@@ -72,7 +71,7 @@ jobs:
7271
./tools/openocd-esp32
7372
./tools/riscv32-*
7473
./tools/xtensa-*
75-
74+
7675
- name: Compile sketch
7776
uses: P-R-O-C-H-Y/compile-sketches@main
7877
with:
@@ -85,6 +84,5 @@ jobs:
8584
cli-compile-flags: |
8685
- --warnings="all"
8786
exit-on-fail: true
88-
sketch-paths:
89-
"- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
87+
sketch-paths: "- ./libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino"
9088
verbose: true

.github/workflows/build_py_tools.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Build Python Tools
33
on:
44
pull_request:
55
paths:
6-
- '.github/workflows/build_py_tools.yml'
7-
- 'tools/get.py'
8-
- 'tools/espota.py'
9-
- 'tools/gen_esp32part.py'
10-
- 'tools/gen_insights_package.py'
6+
- ".github/workflows/build_py_tools.yml"
7+
- "tools/get.py"
8+
- "tools/espota.py"
9+
- "tools/gen_esp32part.py"
10+
- "tools/gen_insights_package.py"
1111

1212
jobs:
1313
find-changed-tools:
@@ -33,8 +33,8 @@ jobs:
3333
uses: tj-actions/changed-files@v41
3434
id: verify-changed-files
3535
with:
36-
fetch_depth: '2'
37-
since_last_remote_commit: 'true'
36+
fetch_depth: "2"
37+
since_last_remote_commit: "true"
3838
files: |
3939
tools/get.py
4040
tools/espota.py
@@ -57,20 +57,20 @@ jobs:
5757
matrix:
5858
os: [windows-latest, macos-latest, ubuntu-20.04, ARM]
5959
include:
60-
- os: windows-latest
61-
TARGET: win64
62-
EXTEN: .exe
63-
SEPARATOR: ';'
64-
- os: macos-latest
65-
TARGET: macos
66-
SEPARATOR: ':'
67-
- os: ubuntu-20.04
68-
TARGET: linux-amd64
69-
SEPARATOR: ':'
70-
- os: ARM
71-
CONTAINER: python:3.8-bullseye
72-
TARGET: arm
73-
SEPARATOR: ':'
60+
- os: windows-latest
61+
TARGET: win64
62+
EXTEN: .exe
63+
SEPARATOR: ";"
64+
- os: macos-latest
65+
TARGET: macos
66+
SEPARATOR: ":"
67+
- os: ubuntu-20.04
68+
TARGET: linux-amd64
69+
SEPARATOR: ":"
70+
- os: ARM
71+
CONTAINER: python:3.8-bullseye
72+
TARGET: arm
73+
SEPARATOR: ":"
7474
container: ${{ matrix.CONTAINER }} # use python container on ARM
7575
env:
7676
DISTPATH: pytools-${{ matrix.TARGET }}

0 commit comments

Comments
 (0)