diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index c8b287609..514277351 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -19,5 +19,8 @@ jobs: run: | yamllint --format github --strict \ device-types/ module-types/ + - name: Format YAML files (yamlfmt) + run: | + pre-commit run --config .pre-commit-yamlfmt-config.yaml --all-files - name: Run tests run: pytest --tb=short -v diff --git a/.pre-commit-yamlfmt-config.yaml b/.pre-commit-yamlfmt-config.yaml new file mode 100644 index 000000000..8441d44fc --- /dev/null +++ b/.pre-commit-yamlfmt-config.yaml @@ -0,0 +1,15 @@ +--- +files: ^(device-types|module-types)/ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + name: Check YAML files + - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.2 + hooks: + - id: yamlfmt + args: [--mapping, '2', --sequence, '4', --offset, '2'] diff --git a/device-types/Cisco/Meraki-M36.yaml b/device-types/Cisco/Meraki-M36.yaml index 6586cf938..c00efbd84 100644 --- a/device-types/Cisco/Meraki-M36.yaml +++ b/device-types/Cisco/Meraki-M36.yaml @@ -5,8 +5,7 @@ slug: cisco-MR36 u_height: 0.0 is_full_depth: false comments: "- Datasheet: [https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR36_Datasheet](https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR36_Datasheet)\r\ - \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h,\ - \ 802.11i, 802.11k, 802.11n, 802.11r, and 802.11u" + \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h, 802.11i, 802.11k, 802.11n, 802.11r, and 802.11u" interfaces: - name: main type: 2.5gbase-t diff --git a/device-types/Cisco/Meraki-M44.yaml b/device-types/Cisco/Meraki-M44.yaml index 4d41f5c27..a13074367 100644 --- a/device-types/Cisco/Meraki-M44.yaml +++ b/device-types/Cisco/Meraki-M44.yaml @@ -5,8 +5,7 @@ slug: cisco-MR44 u_height: 0.0 is_full_depth: false comments: "- Datasheet: [https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR44_Datasheet](https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR44_Datasheet)\r\ - \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h,\ - \ 802.11i, 802.11k, 802.11n, 802.11r, and 802.11u" + \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h, 802.11i, 802.11k, 802.11n, 802.11r, and 802.11u" interfaces: - name: main type: 2.5gbase-t diff --git a/device-types/Cisco/Meraki-MR53.yaml b/device-types/Cisco/Meraki-MR53.yaml index d1bf9bc16..caf512285 100644 --- a/device-types/Cisco/Meraki-MR53.yaml +++ b/device-types/Cisco/Meraki-MR53.yaml @@ -5,8 +5,7 @@ slug: cisco-MR53 is_full_depth: false u_height: 0 comments: "- Datasheet: [https://meraki.cisco.com/product-collateral/mr53-datasheet/?file](https://meraki.cisco.com/product-collateral/mr53-datasheet/?file)\r\ - \n- IEEE Standards: 802.11b, 802.11g, 802.11a, 802.11n, 802.11ac, 802.11h, 802.11i,\ - \ 802.11e, 802.11k, 802.11r, 802.11u" + \n- IEEE Standards: 802.11b, 802.11g, 802.11a, 802.11n, 802.11ac, 802.11h, 802.11i, 802.11e, 802.11k, 802.11r, 802.11u" interfaces: - name: main type: 2.5gbase-t diff --git a/device-types/Cisco/Meraki-MR53E.yaml b/device-types/Cisco/Meraki-MR53E.yaml index 9d9a9da9c..04dbb8056 100644 --- a/device-types/Cisco/Meraki-MR53E.yaml +++ b/device-types/Cisco/Meraki-MR53E.yaml @@ -5,8 +5,7 @@ slug: cisco-MR53E is_full_depth: false u_height: 0 comments: "- Datasheet: [https://meraki.cisco.com/product-collateral/mr53e-datasheet/?file](https://meraki.cisco.com/product-collateral/mr53e-datasheet/?file)\r\ - \n- IEEE Standards: 802.11ac Wave 2, 802.11a, 802.11b, 802.11e, 802.11g, 802.11h,\ - \ 802.11i, 802.11k, 802.11n, 802.11r, 802.11u" + \n- IEEE Standards: 802.11ac Wave 2, 802.11a, 802.11b, 802.11e, 802.11g, 802.11h, 802.11i, 802.11k, 802.11n, 802.11r, 802.11u" interfaces: - name: main type: 2.5gbase-t diff --git a/device-types/Cisco/Meraki-MR56.yaml b/device-types/Cisco/Meraki-MR56.yaml index 10ec4729b..0e9baee92 100644 --- a/device-types/Cisco/Meraki-MR56.yaml +++ b/device-types/Cisco/Meraki-MR56.yaml @@ -5,8 +5,7 @@ slug: cisco-MR56 is_full_depth: false u_height: 0 comments: "- Datasheet: [https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR56_Datasheet](https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR56_Datasheet)\r\ - \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h,\ - \ 802.11i, 802.11k, 802.11n, 802.11r, and 802.11u" + \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h, 802.11i, 802.11k, 802.11n, 802.11r, and 802.11u" interfaces: - name: main type: 2.5gbase-t diff --git a/device-types/Cisco/Meraki-MR57.yaml b/device-types/Cisco/Meraki-MR57.yaml index 2fc2074f2..011bcac09 100644 --- a/device-types/Cisco/Meraki-MR57.yaml +++ b/device-types/Cisco/Meraki-MR57.yaml @@ -5,8 +5,7 @@ slug: cisco-MR57 is_full_depth: false u_height: 0 comments: "- Datasheet: [https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR57_Datasheet](https://documentation.meraki.com/MR/MR_Overview_and_Specifications/MR57_Datasheet)\r\ - \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h,\ - \ 802.11i, 802.11k, 802.11n, 802.11r, 802.11w and 802.11u" + \n- IEEE Standards: 802.11a, 802.11ac, 802.11ax, 802.11b, 802.11e, 802.11g, 802.11h, 802.11i, 802.11k, 802.11n, 802.11r, 802.11w and 802.11u" interfaces: - name: main type: 2.5gbase-t diff --git a/device-types/HPE/HP-5120-24G-PoEP-EI.yaml b/device-types/HPE/HP-5120-24G-PoEP-EI.yaml index 80a0c2c59..d5ddf43b6 100644 --- a/device-types/HPE/HP-5120-24G-PoEP-EI.yaml +++ b/device-types/HPE/HP-5120-24G-PoEP-EI.yaml @@ -5,7 +5,7 @@ slug: hpe-5120-24g-poep-ei part_number: JG236A u_height: 1 is_full_depth: false -comments: "[HPE 5120 EI Switch Series - Specifications](https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c00778577)" +comments: '[HPE 5120 EI Switch Series - Specifications](https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c00778577)' weight: 7.5 weight_unit: kg module-bays: diff --git a/device-types/HPE/HP-5120-48G-PoEP-EI.yaml b/device-types/HPE/HP-5120-48G-PoEP-EI.yaml index f0a0f488a..59664c153 100644 --- a/device-types/HPE/HP-5120-48G-PoEP-EI.yaml +++ b/device-types/HPE/HP-5120-48G-PoEP-EI.yaml @@ -5,7 +5,7 @@ slug: hpe-5120-48g-poep-ei part_number: JG237A u_height: 1 is_full_depth: false -comments: "[HPE 5120 EI Switch Series - Specifications](https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c00778577)" +comments: '[HPE 5120 EI Switch Series - Specifications](https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c00778577)' weight: 7.5 weight_unit: kg module-bays: diff --git a/device-types/Huawei/S3100-8TP-PWR-EI.yaml b/device-types/Huawei/S3100-8TP-PWR-EI.yaml index 4e0c24026..f2522b8b4 100644 --- a/device-types/Huawei/S3100-8TP-PWR-EI.yaml +++ b/device-types/Huawei/S3100-8TP-PWR-EI.yaml @@ -8,7 +8,7 @@ weight: 2.8 weight_unit: kg is_full_depth: false airflow: passive -comments: "H3C S3100-EI Series 10/100 Switches" +comments: H3C S3100-EI Series 10/100 Switches console-ports: - name: console0 type: rj-45 diff --git a/device-types/Nokia/7220-IXR-D1.yaml b/device-types/Nokia/7220-IXR-D1.yaml index 489b644e6..4cb2d4708 100644 --- a/device-types/Nokia/7220-IXR-D1.yaml +++ b/device-types/Nokia/7220-IXR-D1.yaml @@ -123,12 +123,12 @@ interfaces: type: 10gbase-x-sfpp module-bays: - name: PS1 - position: "1" + position: '1' - name: PS2 - position: "2" + position: '2' - name: Fan Tray 1 - position: "1" + position: '1' - name: Fan Tray 2 - position: "2" + position: '2' - name: Fan Tray 3 - position: "3" + position: '3' diff --git a/device-types/Nokia/7220-IXR-D2.yaml b/device-types/Nokia/7220-IXR-D2.yaml index 4656f2cd3..1a6bfa181 100644 --- a/device-types/Nokia/7220-IXR-D2.yaml +++ b/device-types/Nokia/7220-IXR-D2.yaml @@ -133,14 +133,14 @@ interfaces: type: 100gbase-x-qsfp28 module-bays: - name: PS1 - position: "1" + position: '1' - name: PS2 - position: "2" + position: '2' - name: Fan Tray 1 - position: "1" + position: '1' - name: Fan Tray 2 - position: "2" + position: '2' - name: Fan Tray 3 - position: "3" + position: '3' - name: Fan Tray 4 - position: "4" + position: '4' diff --git a/device-types/Nokia/7220-IXR-D2L.yaml b/device-types/Nokia/7220-IXR-D2L.yaml index e314a565c..4695c02b9 100644 --- a/device-types/Nokia/7220-IXR-D2L.yaml +++ b/device-types/Nokia/7220-IXR-D2L.yaml @@ -137,14 +137,14 @@ interfaces: type: 10gbase-x-sfpp module-bays: - name: PS1 - position: "1" + position: '1' - name: PS2 - position: "2" + position: '2' - name: Fan Tray 1 - position: "1" + position: '1' - name: Fan Tray 2 - position: "2" + position: '2' - name: Fan Tray 3 - position: "3" + position: '3' - name: Fan Tray 4 - position: "4" + position: '4' diff --git a/device-types/Nokia/7220-IXR-D3.yaml b/device-types/Nokia/7220-IXR-D3.yaml index 5c6d3bda4..4e728e86c 100644 --- a/device-types/Nokia/7220-IXR-D3.yaml +++ b/device-types/Nokia/7220-IXR-D3.yaml @@ -87,16 +87,16 @@ interfaces: type: 10gbase-x-sfpp module-bays: - name: PS1 - position: "1" + position: '1' - name: PS2 - position: "2" + position: '2' - name: Fan Tray 1 - position: "1" + position: '1' - name: Fan Tray 2 - position: "2" + position: '2' - name: Fan Tray 3 - position: "3" + position: '3' - name: Fan Tray 4 - position: "4" + position: '4' - name: Fan Tray 5 - position: "5" + position: '5' diff --git a/device-types/Nokia/7220-IXR-D3L.yaml b/device-types/Nokia/7220-IXR-D3L.yaml index 32db63e84..97cba45e5 100644 --- a/device-types/Nokia/7220-IXR-D3L.yaml +++ b/device-types/Nokia/7220-IXR-D3L.yaml @@ -87,16 +87,16 @@ interfaces: type: 10gbase-x-sfpp module-bays: - name: PS1 - position: "1" + position: '1' - name: PS2 - position: "2" + position: '2' - name: Fan Tray 1 - position: "1" + position: '1' - name: Fan Tray 2 - position: "2" + position: '2' - name: Fan Tray 3 - position: "3" + position: '3' - name: Fan Tray 4 - position: "4" + position: '4' - name: Fan Tray 5 - position: "5" + position: '5' diff --git a/device-types/Nokia/7220-IXR-H3.yaml b/device-types/Nokia/7220-IXR-H3.yaml index bcbac78ef..d240cec35 100644 --- a/device-types/Nokia/7220-IXR-H3.yaml +++ b/device-types/Nokia/7220-IXR-H3.yaml @@ -87,18 +87,18 @@ interfaces: type: 10gbase-x-sfpp module-bays: - name: PS1 - position: "1" + position: '1' - name: PS2 - position: "2" + position: '2' - name: Fan Tray 1 - position: "1" + position: '1' - name: Fan Tray 2 - position: "2" + position: '2' - name: Fan Tray 3 - position: "3" + position: '3' - name: Fan Tray 4 - position: "4" + position: '4' - name: Fan Tray 5 - position: "5" + position: '5' - name: Fan Tray 6 - position: "6" + position: '6' diff --git a/device-types/Ubiquiti/USW-Enterprise-24-PoE.yaml b/device-types/Ubiquiti/USW-Enterprise-24-PoE.yaml index 81a715774..eb344b539 100644 --- a/device-types/Ubiquiti/USW-Enterprise-24-PoE.yaml +++ b/device-types/Ubiquiti/USW-Enterprise-24-PoE.yaml @@ -3,7 +3,8 @@ manufacturer: Ubiquiti model: UniFi Switch Enterprise 24 PoE slug: ubiquiti-unifi-switch-enterprise-24-poe part_number: USW-Enterprise-24-PoE -comments: 'UniFi Switch Enterprise 24 PoE (150W + max. 400W PoE), (12) 2.5 Gigabit PoE+ IEEE 802.3af/at, (12) 1 Gigabit PoE+ IEEE 802.3af/at, (2) SFP+\nDimensions: 442.4 x 43.7 x 325 mm (17.4 x 1.7 x 12.8")\n[Switch Enterprise 24 PoE Datasheet](https://dl.ui.com/ds/usw-enterprise-24-poe_ds)' +comments: 'UniFi Switch Enterprise 24 PoE (150W + max. 400W PoE), (12) 2.5 Gigabit PoE+ IEEE 802.3af/at, (12) 1 Gigabit PoE+ IEEE 802.3af/at, (2) SFP+\nDimensions: + 442.4 x 43.7 x 325 mm (17.4 x 1.7 x 12.8")\n[Switch Enterprise 24 PoE Datasheet](https://dl.ui.com/ds/usw-enterprise-24-poe_ds)' u_height: 1 is_full_depth: false weight: 11.46