Skip to content

Commit aba769f

Browse files
author
Romain Petit
committed
Merge remote-tracking branch 'origin/main' into main-tokazio
# Conflicts: # app/src/keymap.c
2 parents e2b6e68 + a5c57fa commit aba769f

File tree

963 files changed

+19464
-14885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

963 files changed

+19464
-14885
lines changed

.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/zmkfirmware/zmk-dev-arm:3.0
1+
FROM docker.io/zmkfirmware/zmk-dev-arm:3.2
22

33
COPY .bashrc tmp
44
RUN mv /tmp/.bashrc ~/.bashrc

.github/pull_request_template.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<!-- If you're adding a board/shield please fill out this check-list, otherwise you can delete it -->
2+
23
## Board/Shield Check-list
3-
- [ ] This board/shield is tested working on real hardware
4-
- [ ] Definitions follow the general style of other shields/boards upstream ([Reference](https://zmk.dev/docs/development/new-shield))
5-
- [ ] `.zmk.yml` metadata file added
6-
- [ ] Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
7-
- [ ] General consistent formatting of DeviceTree files
8-
- [ ] Keymaps do not use deprecated key defines (Check using the [upgrader tool](https://zmk.dev/docs/codes/keymap-upgrader))
9-
- [ ] `&pro_micro` used in favor of `&pro_micro_d/a` if applicable
10-
- [ ] If split, no name added for the right/peripheral half
11-
- [ ] Kconfig.defconfig file correctly wraps *all* configuration in conditional on the shield symbol
12-
- [ ] `.conf` file has optional extra features commented out
13-
- [ ] Keyboard/PCB is part of a shipped group buy or is generally available in stock to purchase (OSH/personal projects without general availability should create a zmk-config repo instead)
4+
5+
- [ ] This board/shield is tested working on real hardware
6+
- [ ] Definitions follow the general style of other shields/boards upstream ([Reference](https://zmk.dev/docs/development/new-shield))
7+
- [ ] `.zmk.yml` metadata file added
8+
- [ ] Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
9+
- [ ] General consistent formatting of DeviceTree files
10+
- [ ] Keymaps do not use deprecated key defines (Check using the [upgrader tool](https://zmk.dev/docs/codes/keymap-upgrader))
11+
- [ ] `&pro_micro` used in favor of `&pro_micro_d/a` if applicable
12+
- [ ] If split, no name added for the right/peripheral half
13+
- [ ] Kconfig.defconfig file correctly wraps _all_ configuration in conditional on the shield symbol
14+
- [ ] `.conf` file has optional extra features commented out
15+
- [ ] Keyboard/PCB is part of a shipped group buy or is generally available in stock to purchase (OSH/personal projects without general availability should create a zmk-config repo instead)

.github/workflows/build-user-config.yml

+12-17
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ on:
1919
required: false
2020
type: string
2121
archive_name:
22-
description: 'Archive output file name'
23-
default: 'firmware'
22+
description: "Archive output file name"
23+
default: "firmware"
2424
required: false
2525
type: string
2626

@@ -39,8 +39,8 @@ jobs:
3939

4040
- name: Fetch Build Matrix
4141
run: |
42-
echo "build_matrix=$(yaml2json ${{ inputs.build_matrix_path }} | jq -c .)" >> $GITHUB_ENV
43-
yaml2json ${{ inputs.build_matrix_path }} | jq
42+
echo "build_matrix=$(yaml2json '${{ inputs.build_matrix_path }}' | jq -c .)" >> $GITHUB_ENV
43+
yaml2json "${{ inputs.build_matrix_path }}" | jq
4444
4545
build:
4646
runs-on: ubuntu-latest
@@ -54,18 +54,13 @@ jobs:
5454
steps:
5555
- name: Prepare variables
5656
shell: sh -x {0}
57+
env:
58+
shield: ${{ matrix.shield }}
5759
run: |
58-
if [ -n "${{ matrix.shield }}" ]
59-
then
60-
echo "extra_cmake_args=-DSHIELD=\"${{ matrix.shield }}\"" >> $GITHUB_ENV
61-
echo "artifact_name=${{ matrix.shield }}-${{ matrix.board }}-zmk" >> $GITHUB_ENV
62-
echo "display_name=${{ matrix.shield }} - ${{ matrix.board }}" >> $GITHUB_ENV
63-
else
64-
echo "extra_cmake_args=" >> $GITHUB_ENV
65-
echo "artifact_name=${{ matrix.board }}-zmk" >> $GITHUB_ENV
66-
echo "display_name=${{ matrix.board }}" >> $GITHUB_ENV
67-
fi
6860
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
61+
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}" >> $GITHUB_ENV
62+
echo "display_name=${shield:+$shield - }${{ matrix.board }}" >> $GITHUB_ENV
63+
echo "artifact_name=${shield:+$shield-}${{ matrix.board }}-zmk" >> $GITHUB_ENV
6964
7065
- name: Checkout
7166
uses: actions/checkout@v3
@@ -89,7 +84,7 @@ jobs:
8984
${{ runner.os }}-
9085
9186
- name: West Init
92-
run: west init -l ${{ inputs.config_path }}
87+
run: west init -l "${{ inputs.config_path }}"
9388

9489
- name: West Update
9590
run: west update
@@ -99,7 +94,7 @@ jobs:
9994

10095
- name: West Build (${{ env.display_name }})
10196
shell: sh -x {0}
102-
run: west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
97+
run: west build -s zmk/app -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
10398

10499
- name: ${{ env.display_name }} Kconfig file
105100
run: grep -v -e "^#" -e "^$" build/zephyr/.config | sort
@@ -113,7 +108,7 @@ jobs:
113108
cp build/zephyr/zmk.uf2 "build/artifacts/${{ env.artifact_name }}.uf2"
114109
elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ]
115110
then
116-
cp build/zephyr/zmk.${{ inputs.fallback_binary }} "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
111+
cp "build/zephyr/zmk.${{ inputs.fallback_binary }}" "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
117112
fi
118113
119114
- name: Archive (${{ env.display_name }})

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
if: ${{ always() }}
1818
runs-on: ubuntu-latest
1919
container:
20-
image: docker.io/zmkfirmware/zmk-build-arm:3.0
20+
image: docker.io/zmkfirmware/zmk-build-arm:3.2
2121
needs: compile-matrix
2222
strategy:
2323
matrix:
@@ -131,7 +131,7 @@ jobs:
131131
for (const configuration of combinedUnique) {
132132
if (!perBoard[configuration.board])
133133
perBoard[configuration.board] = [];
134-
134+
135135
perBoard[configuration.board].push({
136136
shield: configuration.shield,
137137
'cmake-args': configuration['cmake-args'],
@@ -234,7 +234,7 @@ jobs:
234234
};
235235
}
236236
} else if (hm.exposes) {
237-
return hm.exposes.flatMap(i =>
237+
return hm.exposes.flatMap(i =>
238238
metadata.interconnects[i].shields.flatMap(s => boardAndShield(hm, s))
239239
);
240240
} else {
@@ -243,7 +243,7 @@ jobs:
243243
break;
244244
case "shield":
245245
if (hm.features && hm.features.includes("keys")) {
246-
return hm.requires.flatMap(i =>
246+
return hm.requires.flatMap(i =>
247247
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
248248
);
249249
} else {

.github/workflows/clang-format-lint.yml

-29
This file was deleted.

.github/workflows/doc-checks.yml

-10
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ jobs:
2121
- name: ESLint
2222
run: npm run lint
2323
working-directory: docs
24-
prettier:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v3
28-
- uses: bahmutov/npm-install@v1
29-
with:
30-
working-directory: docs
31-
- name: Prettier check
32-
run: npm run prettier:check
33-
working-directory: docs
3424
typecheck:
3525
runs-on: ubuntu-latest
3626
steps:

.github/workflows/hardware-metadata-validation.yml

+1-12
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,10 @@ on:
1515
- "app/scripts/west_commands/metadata.py"
1616

1717
jobs:
18-
check-metadata-format:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/checkout@v3
23-
- uses: bahmutov/npm-install@v1
24-
with:
25-
working-directory: app
26-
- name: Prettier Check
27-
run: npm run prettier:check
28-
working-directory: app
2918
validate-metadata:
3019
runs-on: ubuntu-latest
3120
container:
32-
image: docker.io/zmkfirmware/zmk-dev-arm:3.0
21+
image: docker.io/zmkfirmware/zmk-dev-arm:3.2
3322
steps:
3423
- uses: actions/checkout@v3
3524
- name: Install dependencies

.github/workflows/pre-commit.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: 3.x
15+
- uses: pre-commit/[email protected]

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
3434
runs-on: ubuntu-latest
3535
container:
36-
image: docker.io/zmkfirmware/zmk-build-arm:3.0
36+
image: docker.io/zmkfirmware/zmk-build-arm:3.2
3737
steps:
3838
- name: Checkout
3939
uses: actions/checkout@v3

.pre-commit-config.yaml

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
fail_fast: false
22
repos:
3+
- repo: https://github.com/Lucas-C/pre-commit-hooks
4+
rev: v1.5.1
5+
hooks:
6+
- id: remove-tabs
7+
exclude: "vendor-prefixes\\.txt$"
38
- repo: https://github.com/pocc/pre-commit-hooks
4-
rev: v1.1.1
9+
rev: v1.3.5
510
hooks:
611
- id: clang-format
712
args:
813
- -i
914
- repo: https://github.com/pre-commit/mirrors-prettier
10-
rev: v2.2.1
15+
rev: v2.7.1
1116
hooks:
1217
- id: prettier
18+
# Workaround for https://github.com/pre-commit/mirrors-prettier/issues/29
19+
additional_dependencies:
20+
21+
- repo: https://github.com/pre-commit/pre-commit-hooks
22+
rev: v4.4.0
23+
hooks:
24+
- id: trailing-whitespace
25+
- id: check-yaml
26+
- id: check-added-large-files
27+
- id: check-shebang-scripts-are-executable
28+
exclude: "\\.mustache$"

.vscode/extensions.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode",
4+
"ms-python.python",
5+
"ms-vscode.cpptools",
6+
"plorefice.devicetree",
7+
"twxs.cmake"
8+
]
9+
}

.vscode/settings.json

+17-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,20 @@
33
"*.overlay": "dts",
44
"*.keymap": "dts"
55
},
6-
"python.formatting.provider": "black"
7-
}
6+
"python.formatting.provider": "black",
7+
"[c]": {
8+
"editor.formatOnSave": true
9+
},
10+
"[javascript][javascriptreact][typescript][typescriptreact]": {
11+
"editor.formatOnSave": true,
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[python]": {
15+
"editor.formatOnSave": true,
16+
"editor.defaultFormatter": "ms-python.python"
17+
},
18+
"[css][json][jsonc][html][markdown][yaml]": {
19+
"editor.formatOnSave": true,
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
21+
}
22+
}

app/.prettierrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
endOfLine: "auto",
2+
endOfLine: "auto",
33
};

app/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
5151
target_sources(app PRIVATE src/behaviors/behavior_to_layer.c)
5252
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
5353
target_sources(app PRIVATE src/behaviors/behavior_none.c)
54-
target_sources(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c)
54+
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE app PRIVATE src/behaviors/behavior_sensor_rotate.c)
55+
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_VAR app PRIVATE src/behaviors/behavior_sensor_rotate_var.c)
56+
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON app PRIVATE src/behaviors/behavior_sensor_rotate_common.c)
5557
target_sources(app PRIVATE src/combo.c)
5658
target_sources(app PRIVATE src/behaviors/behavior_tap_dance.c)
5759
target_sources(app PRIVATE src/behavior_queue.c)

0 commit comments

Comments
 (0)