Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into keyboard_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszduda23 committed Aug 20, 2023
2 parents 901d4aa + f16a24d commit bec8a1b
Show file tree
Hide file tree
Showing 503 changed files with 20,375 additions and 5,516 deletions.
15 changes: 13 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ Checks: >-
-altera-*,
-android-*,
-boost-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-cert-dcl50-cpp,
-cert-err33-c,
-cert-err58-cpp,
-cert-oop57-cpp,
-cert-str34-c,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-osx.*,
-clang-diagnostic-delete-abstract-non-virtual-dtor,
-clang-diagnostic-delete-non-abstract-non-virtual-dtor,
-clang-diagnostic-ignored-optimization-argument,
-clang-diagnostic-shadow-field,
-clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-parameter,
Expand All @@ -25,6 +29,7 @@ Checks: >-
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
Expand All @@ -36,6 +41,7 @@ Checks: >-
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-virtual-class-destructor,
-fuchsia-multiple-inheritance,
-fuchsia-overloaded-operator,
-fuchsia-statically-constructed-objects,
Expand Down Expand Up @@ -68,6 +74,7 @@ Checks: >-
-modernize-use-nodiscard,
-mpi-*,
-objc-*,
-readability-container-data-pointer,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
Expand All @@ -82,8 +89,6 @@ WarningsAsErrors: '*'
AnalyzeTemporaryDtors: false
FormatStyle: google
CheckOptions:
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-runtime-int.TypeSuffix
Expand Down Expand Up @@ -158,3 +163,9 @@ CheckOptions:
value: ''
- key: readability-qualified-auto.AddConstToQualified
value: 0
- key: readability-identifier-length.MinimumVariableNameLength
value: 0
- key: readability-identifier-length.MinimumParameterNameLength
value: 0
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 0
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"yaml.customTags": [
"!secret scalar",
"!lambda scalar",
"!extend scalar",
"!include_dir_named scalar",
"!include_dir_list scalar",
"!include_dir_merge_list scalar",
Expand Down
38 changes: 38 additions & 0 deletions .github/actions/restore-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Restore Python
inputs:
python-version:
description: Python version to restore
required: true
type: string
cache-key:
description: Cache key to use
required: true
type: string
outputs:
python-version:
description: Python version restored
value: ${{ steps.python.outputs.python-version }}
runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ inputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache/[email protected]
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ inputs.cache-key }}
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
shell: bash
run: |
python -m venv venv
. venv/bin/activate
python --version
pip install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
pip install -e .
98 changes: 44 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ jobs:
common:
name: Create common environment
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Generate cache-key
id: cache-key
run: echo key="${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}" >> $GITHUB_OUTPUT
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
Expand All @@ -39,7 +45,7 @@ jobs:
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ steps.cache-key.outputs.key }}
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
Expand All @@ -66,12 +72,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run black
run: |
. venv/bin/activate
Expand All @@ -88,12 +93,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run flake8
run: |
. venv/bin/activate
Expand All @@ -110,12 +114,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run pylint
run: |
. venv/bin/activate
Expand All @@ -132,12 +135,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run pyupgrade
run: |
. venv/bin/activate
Expand All @@ -154,12 +156,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Register matcher
run: echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
- name: Run script/ci-custom
Expand All @@ -176,12 +177,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Register matcher
run: echo "::add-matcher::.github/workflows/matchers/pytest.json"
- name: Run pytest
Expand All @@ -197,12 +197,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Install clang-format
run: |
. venv/bin/activate
Expand Down Expand Up @@ -237,18 +236,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/[email protected]
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
- name: Cache platformio
uses: actions/[email protected]
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-test${{ matrix.file }}-${{ hashFiles('platformio.ini') }}
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run esphome compile tests/test${{ matrix.file }}.yaml
run: |
. venv/bin/activate
Expand Down Expand Up @@ -300,13 +292,11 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Restore Python virtual environment
uses: actions/cache/restore@v3.3.1
- name: Restore Python
uses: ./.github/actions/restore-python
with:
path: venv
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ env.DEFAULT_PYTHON }}-venv-${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}
# Use per check platformio cache because checks use different parts
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Cache platformio
uses: actions/[email protected]
with:
Expand All @@ -315,7 +305,7 @@ jobs:
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}

- name: Install clang-tidy
run: sudo apt-get install clang-tidy-11
run: sudo apt-get install clang-tidy-14

- name: Register problem matchers
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ jobs:
with:
python-version: "3.x"
- name: Set up python environment
env:
ESPHOME_NO_VENV: 1
run: |
script/setup
pip install setuptools wheel twine
pip install twine
- name: Build
run: python setup.py sdist bdist_wheel
- name: Upload
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/sync-device-classes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ on:
schedule:
- cron: '45 6 * * *'

permissions:
contents: write
pull-requests: write

jobs:
sync:
name: Sync Device Classes
runs-on: ubuntu-latest
if: github.repository == 'esphome/esphome'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -38,15 +36,6 @@ jobs:
run: |
python ./script/sync-device_class.py
- name: Get PR template
id: pr-template-body
run: |
body=$(cat .github/PULL_REQUEST_TEMPLATE.md)
delimiter="$(openssl rand -hex 8)"
echo "body<<$delimiter" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "$delimiter" >> $GITHUB_OUTPUT
- name: Commit changes
uses: peter-evans/create-pull-request@v5
with:
Expand All @@ -56,5 +45,5 @@ jobs:
branch: sync/device-classes
delete-branch: true
title: "Synchronise Device Classes from Home Assistant"
body: ${{ steps.pr-template-body.outputs.body }}
body-path: .github/PULL_REQUEST_TEMPLATE.md
token: ${{ secrets.DEVICE_CLASS_SYNC_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ tests/.esphome/
sdkconfig.*
!sdkconfig.defaults

.tests/
.tests/

/components
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
args:
Expand All @@ -27,7 +27,7 @@ repos:
- --branch=release
- --branch=beta
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py39-plus]
Loading

0 comments on commit bec8a1b

Please sign in to comment.