Skip to content

Commit

Permalink
Fix doc build issue in ERROR_CODES.md (#25894)
Browse files Browse the repository at this point in the history
* edit_table.py: fix issue breaking SDK doc build

Removed period from the ASN.1 entry as it is breaking markdown formatting and the whole SDK doc build.
Checked against headers in src\lib\asn1, which allow ASN1 without the period.

Signed-off-by: Grzegorz Ferenc <[email protected]>

* error_table.py: remove lines creating Myst issue

Removed lines that caused the docbuild to fail with
"src/ERROR_CODES.md:259: WARNING: Duplicate reference definition:
// [myst.duplicate_def]" issue.

These lines excluded ERROR_CODES.md from spellchecking, but this
exclusion is already ensured by line 68 in .spellcheck.yml.

Signed-off-by: Grzegorz Ferenc <[email protected]>

* Restyled by autopep8

* doc: Fix dependancy version

Fix version of dependancy pydata-sphinx-theme to 0.13.1
since v0.13.2 introduced breaking changes.

Signed-off-by: Gaute Svanes Lunde <[email protected]>

---------

Signed-off-by: Grzegorz Ferenc <[email protected]>
Signed-off-by: Gaute Svanes Lunde <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Gaute Svanes Lunde <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Jul 13, 2023
1 parent f18e58d commit 1480548
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions docs/ERROR_CODES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[//]: # "start_ignore_spellcheck"

# Matter SDK `CHIP_ERROR` enums values

This file was **AUTOMATICALLY** generated by
Expand All @@ -10,7 +8,7 @@ This file was **AUTOMATICALLY** generated by
- [SDK Core errors: range `0x000..0x0FF`](#sdk-core-errors)
- [SDK Inet Layer errors: range `0x100..0x1FF`](#sdk-inet-layer-errors)
- [SDK Device Layer errors: range `0x200..0x2FF`](#sdk-device-layer-errors)
- [ASN.1 Layer errors: range `0x300..0x3FF`](#asn-1-layer-errors)
- [ASN1 Layer errors: range `0x300..0x3FF`](#asn1-layer-errors)
- [BLE Layer errors: range `0x400..0x4FF`](#ble-layer-errors)
- [IM Global errors errors: range `0x500..0x5FF`](#im-global-errors-errors)

Expand Down Expand Up @@ -179,7 +177,7 @@ This file was **AUTOMATICALLY** generated by
| 515 | 0x203 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_ABORTED` |
| 516 | 0x204 | `CHIP_DEVICE_ERROR_SOFTWARE_UPDATE_IGNORED` |

## ASN.1 Layer errors
## ASN1 Layer errors

| Decimal | Hex | Name |
| ------- | ----- | --------------------------------- |
Expand Down Expand Up @@ -255,5 +253,3 @@ This file was **AUTOMATICALLY** generated by
| 1481 | 0x5C9 | `TIMED_REQUEST_MISMATCH` |
| 1482 | 0x5CA | `FAILSAFE_REQUIRED` |
| 1520 | 0x5F0 | `WRITE_IGNORED` |

[//]: # "end_ignore_spellcheck"
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Sphinx>=4.5
sphinx-book-theme
myst-parser
breathe>=4.34
pydata-sphinx-theme==0.13.1
7 changes: 1 addition & 6 deletions scripts/error_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,11 @@ def main():
"src/lib/core/CHIPError.h": ErrorDescriptor(section="SDK Core", code_range=0x000, macro_regex=r"^#define\s+(?P<name>[_A-Z0-9]+)\s+CHIP(_CORE)?_ERROR[(](?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
"src/inet/InetError.h": ErrorDescriptor(section="SDK Inet Layer", code_range=0x100, macro_regex=r"^#define\s+(?P<name>[_A-Z0-9]+)\s+CHIP_INET_ERROR[(](?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
"src/include/platform/CHIPDeviceError.h": ErrorDescriptor(section="SDK Device Layer", code_range=0x200, macro_regex=r"^#define\s+(?P<name>[_A-Z0-9]+)\s+CHIP_DEVICE_ERROR[(](?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
"src/lib/asn1/ASN1Error.h": ErrorDescriptor(section="ASN.1 Layer", code_range=0x300, macro_regex=r"^#define\s+(?P<name>[_A-Z0-9]+)\s+CHIP_ASN1_ERROR[(](?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
"src/lib/asn1/ASN1Error.h": ErrorDescriptor(section="ASN1 Layer", code_range=0x300, macro_regex=r"^#define\s+(?P<name>[_A-Z0-9]+)\s+CHIP_ASN1_ERROR[(](?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
"src/ble/BleError.h": ErrorDescriptor(section="BLE Layer", code_range=0x400, macro_regex=r"^#define\s+(?P<name>[_A-Z0-9]+)\s+CHIP_BLE_ERROR[(](?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
"src/protocols/interaction_model/StatusCodeList.h": ErrorDescriptor(section="IM Global errors", code_range=0x500, macro_regex=r"^CHIP_IM_STATUS_CODE[(][A-Za-z0-9_]+\s*,\s*(?P<name>[A-Z0-9_]+)\s*,\s*(?P<code>(0x[a-fA-F0-9]+)|\d+)[)]"),
}

print()
print("[//]: # (start_ignore_spellcheck)")
print()
print("# Matter SDK `CHIP_ERROR` enums values")
print()
print("This file was **AUTOMATICALLY** generated by `python scripts/error_table.py > docs/ERROR_CODES.md`.")
Expand All @@ -157,8 +154,6 @@ def main():
for filename, descriptor in descriptors.items():
dump_table(Path(filename), descriptor)

print("[//]: # (end_ignore_spellcheck)")


if __name__ == "__main__":
main()

0 comments on commit 1480548

Please sign in to comment.