diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e8f892465..8b4aafb1dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ on: - "**" - "!.github/workflows/*.yml" - ".github/workflows/ci.yml" + - "!.yamllint" merge_group: permissions: diff --git a/.github/workflows/needs-docs.yml b/.github/workflows/needs-docs.yml index 628b5cc5e3..6a66e5769c 100644 --- a/.github/workflows/needs-docs.yml +++ b/.github/workflows/needs-docs.yml @@ -1,5 +1,6 @@ name: Needs Docs +# yamllint disable-line rule:truthy on: pull_request: types: [labeled, unlabeled] diff --git a/.github/workflows/sync-device-classes.yml b/.github/workflows/sync-device-classes.yml index a5bd178e33..efa1aefae5 100644 --- a/.github/workflows/sync-device-classes.yml +++ b/.github/workflows/sync-device-classes.yml @@ -1,6 +1,7 @@ --- name: Synchronise Device Classes from Home Assistant +# yamllint disable-line rule:truthy on: workflow_dispatch: schedule: diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 1bfa70c455..3694436866 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -1,5 +1,7 @@ +--- name: YAML lint +# yamllint disable-line rule:truthy on: push: branches: [dev, beta, release] @@ -20,3 +22,5 @@ jobs: uses: actions/checkout@v4.1.1 - name: Run yamllint uses: frenck/action-yamllint@v1.5.0 + with: + strict: true diff --git a/.yamllint b/.yamllint index 4fea263214..9cd1482869 100644 --- a/.yamllint +++ b/.yamllint @@ -1,3 +1,18 @@ --- -ignore: | - venv/ +extends: default + +ignore-from-file: .gitignore + +rules: + document-start: disable + empty-lines: + level: error + max: 1 + max-start: 0 + max-end: 1 + indentation: + level: error + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + line-length: disable diff --git a/tests/components/animation/test.esp32-c3-idf.yaml b/tests/components/animation/test.esp32-c3-idf.yaml index 9a415255ae..9bcfbdb118 100644 --- a/tests/components/animation/test.esp32-c3-idf.yaml +++ b/tests/components/animation/test.esp32-c3-idf.yaml @@ -20,4 +20,4 @@ animation: - id: rgb565_animation file: ../../pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false diff --git a/tests/components/animation/test.esp32-c3.yaml b/tests/components/animation/test.esp32-c3.yaml index 9a415255ae..9bcfbdb118 100644 --- a/tests/components/animation/test.esp32-c3.yaml +++ b/tests/components/animation/test.esp32-c3.yaml @@ -20,4 +20,4 @@ animation: - id: rgb565_animation file: ../../pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false diff --git a/tests/components/animation/test.esp32-idf.yaml b/tests/components/animation/test.esp32-idf.yaml index 31b78eb980..5dc132eb2d 100644 --- a/tests/components/animation/test.esp32-idf.yaml +++ b/tests/components/animation/test.esp32-idf.yaml @@ -20,4 +20,4 @@ animation: - id: rgb565_animation file: ../../pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false diff --git a/tests/components/animation/test.esp32.yaml b/tests/components/animation/test.esp32.yaml index 31b78eb980..5dc132eb2d 100644 --- a/tests/components/animation/test.esp32.yaml +++ b/tests/components/animation/test.esp32.yaml @@ -20,4 +20,4 @@ animation: - id: rgb565_animation file: ../../pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false diff --git a/tests/components/animation/test.esp8266.yaml b/tests/components/animation/test.esp8266.yaml index 2bd441de99..ef0f483a79 100644 --- a/tests/components/animation/test.esp8266.yaml +++ b/tests/components/animation/test.esp8266.yaml @@ -20,4 +20,4 @@ animation: - id: rgb565_animation file: ../../pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false diff --git a/tests/components/animation/test.rp2040.yaml b/tests/components/animation/test.rp2040.yaml index 0f42c33687..6ee29a3347 100644 --- a/tests/components/animation/test.rp2040.yaml +++ b/tests/components/animation/test.rp2040.yaml @@ -20,4 +20,4 @@ animation: - id: rgb565_animation file: ../../pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false diff --git a/tests/components/mopeka_std_check/test.esp32.yaml b/tests/components/mopeka_std_check/test.esp32.yaml index 830adf952f..383e2e2a19 100644 --- a/tests/components/mopeka_std_check/test.esp32.yaml +++ b/tests/components/mopeka_std_check/test.esp32.yaml @@ -6,11 +6,10 @@ sensor: mac_address: D3:75:F2:DC:16:91 tank_type: Europe_11kg temperature: - name: "Propane test temp" + name: "Propane test temp" level: - name: "Propane test level" + name: "Propane test level" distance: - name: "Propane test distance" + name: "Propane test distance" battery_level: - name: "Propane test battery level" - + name: "Propane test battery level" diff --git a/tests/test1.yaml b/tests/test1.yaml index c2b92c2b21..57456e7d6d 100644 --- a/tests/test1.yaml +++ b/tests/test1.yaml @@ -380,7 +380,7 @@ ble_client: then: - ble_client.numeric_comparison_reply: id: ble_blah - accept: True + accept: true - mac_address: C4:4F:33:11:22:33 id: my_bedjet_ble_client @@ -2053,7 +2053,7 @@ binary_sensor: on_press: - fan.cycle_speed: id: fan_speed - off_speed_cycle: False + off_speed_cycle: false - logger.log: "Cycle speed clicked" - platform: remote_receiver name: Raw Remote Receiver Test @@ -2312,7 +2312,7 @@ output: pin: pcf8574: pcf8574_hub number: 0 - #allow_other_uses: true + # allow_other_uses: true mode: OUTPUT inverted: false - platform: gpio @@ -2320,7 +2320,7 @@ output: pin: pca9554: pca9554_hub number: 0 - #allow_other_uses: true + # allow_other_uses: true mode: OUTPUT inverted: false - platform: gpio @@ -3411,7 +3411,7 @@ display: reset_pin: allow_other_uses: true number: GPIO23 - backlight_pin: no + backlight_pin: false lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - platform: st7920 diff --git a/tests/test11.5.yaml b/tests/test11.5.yaml index 2a9b40c5c3..ef260d79c0 100644 --- a/tests/test11.5.yaml +++ b/tests/test11.5.yaml @@ -116,7 +116,7 @@ binary_sensor: id: modbus_binsensortest register_type: read address: 0x3200 - bitmask: 0x80 # (bit 8) + bitmask: 0x80 # (bit 8) lambda: "return x;" - platform: tm1638 @@ -714,9 +714,9 @@ display: id: primarydisplay stb_pin: allow_other_uses: true - number: 5 #TM1638 STB - clk_pin: 18 #TM1638 CLK - dio_pin: 23 #TM1638 DIO + number: 5 # TM1638 STB + clk_pin: 18 # TM1638 CLK + dio_pin: 23 # TM1638 DIO update_interval: 5s intensity: 5 lambda: |- diff --git a/tests/test2.yaml b/tests/test2.yaml index e5358781df..f7a690709a 100644 --- a/tests/test2.yaml +++ b/tests/test2.yaml @@ -8,7 +8,7 @@ esphome: globals: - id: my_global_string type: std::string - restore_value: yes + restore_value: true max_restore_data_length: 70 initial_value: '"DefaultValue"' @@ -786,11 +786,11 @@ image: - id: rgb24_image file: pnglogo.png type: RGB24 - use_transparency: yes + use_transparency: true - id: rgb565_image file: pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false - id: web_svg_image file: https://raw.githubusercontent.com/esphome/esphome-docs/a62d7ab193c1a464ed791670170c7d518189109b/images/logo.svg resize: 256x48 diff --git a/tests/test3.1.yaml b/tests/test3.1.yaml index fca37054a7..2bddd6f4d7 100644 --- a/tests/test3.1.yaml +++ b/tests/test3.1.yaml @@ -503,7 +503,7 @@ switch: - platform: template name: open_vent id: open_vent - optimistic: True + optimistic: true on_turn_on: then: - grove_tb6612fng.run: diff --git a/tests/test3.yaml b/tests/test3.yaml index cbd3d15b8a..68b9a544e1 100644 --- a/tests/test3.yaml +++ b/tests/test3.yaml @@ -1035,34 +1035,34 @@ climate: target_temperature: 1 current_temperature: 0.5 supported_modes: - - 'OFF' - - HEAT_COOL - - COOL - - HEAT - - DRY - - FAN_ONLY + - "OFF" + - HEAT_COOL + - COOL + - HEAT + - DRY + - FAN_ONLY supported_swing_modes: - - 'OFF' - - VERTICAL - - HORIZONTAL - - BOTH + - "OFF" + - VERTICAL + - HORIZONTAL + - BOTH supported_presets: - - AWAY - - BOOST - - ECO - - SLEEP + - AWAY + - BOOST + - ECO + - SLEEP on_alarm_start: then: - logger.log: level: DEBUG - format: "Alarm activated. Code: %d. Message: \"%s\"" - args: [ code, message] + format: 'Alarm activated. Code: %d. Message: "%s"' + args: [code, message] on_alarm_end: then: - logger.log: level: DEBUG - format: "Alarm deactivated. Code: %d. Message: \"%s\"" - args: [ code, message] + format: 'Alarm deactivated. Code: %d. Message: "%s"' + args: [code, message] sprinkler: - id: yard_sprinkler_ctrlr diff --git a/tests/test4.yaml b/tests/test4.yaml index f68406298e..e46102e88a 100644 --- a/tests/test4.yaml +++ b/tests/test4.yaml @@ -477,7 +477,6 @@ binary_sensor: sx1509: sx1509_hub number: 3 - - platform: touchscreen touchscreen_id: lilygo_touchscreen id: touch_key1 @@ -491,7 +490,6 @@ binary_sensor: id: touch_key_911 index: 0 - - platform: gpio name: MaxIn Pin 4 pin: @@ -521,7 +519,6 @@ binary_sensor: input: true inverted: false - climate: - platform: tuya id: tuya_climate @@ -591,7 +588,6 @@ cover: open_duration: 14s close_duration: 14s - display: - platform: addressable_light id: led_matrix_32x8_display @@ -885,16 +881,16 @@ esp32_camera: allow_other_uses: true - number: GPIO35 allow_other_uses: true - - number: GPIO34 - - number: GPIO5 + - number: GPIO34 + - number: GPIO5 allow_other_uses: true - - number: GPIO39 + - number: GPIO39 allow_other_uses: true - - number: GPIO18 + - number: GPIO18 allow_other_uses: true - - number: GPIO36 + - number: GPIO36 allow_other_uses: true - - number: GPIO19 + - number: GPIO19 allow_other_uses: true vsync_pin: allow_other_uses: true @@ -927,8 +923,8 @@ esp32_camera: jpeg_quality: 10 on_image: then: - - lambda: |- - ESP_LOGD("main", "image len=%d, data=%c", image.length, image.data[0]); + - lambda: |- + ESP_LOGD("main", "image len=%d, data=%c", image.length, image.data[0]); esp32_camera_web_server: - port: 8080 @@ -1004,7 +1000,6 @@ touchscreen: number: GPIO3 display: inkplate_display - - platform: ft63x6 id: ft63_touchscreen interrupt_pin: @@ -1012,7 +1007,7 @@ touchscreen: number: GPIO39 reset_pin: allow_other_uses: true - number: GPIO5 + number: GPIO5 display: inkplate_display on_touch: - logger.log: diff --git a/tests/test5.yaml b/tests/test5.yaml index bf4247fb92..55efba57d1 100644 --- a/tests/test5.yaml +++ b/tests/test5.yaml @@ -100,7 +100,7 @@ binary_sensor: id: modbus_binsensortest register_type: read address: 0x3200 - bitmask: 0x80 # (bit 8) + bitmask: 0x80 # (bit 8) lambda: "return x;" - platform: tm1638 @@ -632,9 +632,9 @@ display: id: primarydisplay stb_pin: allow_other_uses: true - number: 5 #TM1638 STB - clk_pin: 18 #TM1638 CLK - dio_pin: 23 #TM1638 DIO + number: 5 # TM1638 STB + clk_pin: 18 # TM1638 CLK + dio_pin: 23 # TM1638 DIO update_interval: 5s intensity: 5 lambda: |- diff --git a/tests/test6.yaml b/tests/test6.yaml index b0ec04eb6a..2c5aa30aad 100644 --- a/tests/test6.yaml +++ b/tests/test6.yaml @@ -42,7 +42,6 @@ switch: output: pin_4 id: pin_4_switch - spi: # Pins are for SPI1 on the RP2040 Pico-W miso_pin: 8 clk_pin: 10 @@ -50,7 +49,7 @@ spi: # Pins are for SPI1 on the RP2040 Pico-W id: spi_0 interface: hardware -#light: +# light: # - platform: rp2040_pio_led_strip # id: led_strip # pin: GPIO13 @@ -69,7 +68,6 @@ spi: # Pins are for SPI1 on the RP2040 Pico-W # bit1_high: .69us # bit1_low: .4us - sensor: - platform: internal_temperature name: Internal Temperature diff --git a/tests/test8.1.yaml b/tests/test8.1.yaml index 839b1f3e6e..fdfa8bc786 100644 --- a/tests/test8.1.yaml +++ b/tests/test8.1.yaml @@ -24,15 +24,14 @@ psram: spi: - id: spi_id_1 clk_pin: - number: GPIO7 + number: GPIO7 allow_other_uses: false mosi_pin: GPIO6 interface: any - id: quad_spi clk_pin: 47 data_pins: - - - number: 40 + - number: 40 allow_other_uses: false - 41 - 42 diff --git a/tests/test8.2.yaml b/tests/test8.2.yaml index 69525b333b..ae892559e5 100644 --- a/tests/test8.2.yaml +++ b/tests/test8.2.yaml @@ -24,7 +24,7 @@ psram: spi: - id: spi_id_1 clk_pin: - number: GPIO7 + number: GPIO7 allow_other_uses: false mosi_pin: GPIO6 interface: any diff --git a/tests/test8.yaml b/tests/test8.yaml index fafdb76e12..5618e23e25 100644 --- a/tests/test8.yaml +++ b/tests/test8.yaml @@ -101,4 +101,4 @@ animation: - id: rgb565_animation file: pnglogo.png type: RGB565 - use_transparency: no + use_transparency: false