Skip to content

fix(all-toc-issues): repair all toc issues and add a check for the future #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d5eca8d
feat(check_toc_txt): add a script lint toc.txt
StaticRocket Jun 11, 2025
37b2357
fix(machine-learning): remove invalid toc entries
StaticRocket Jun 11, 2025
d10f468
fix(power-management): repair old toc entries
StaticRocket Jun 11, 2025
c563ed1
fix(j7): remove Release_Specific_QSG toc entries
StaticRocket Jun 11, 2025
86bb144
fix(u-boot): remove release notes from toc
StaticRocket Jun 11, 2025
ea0e41a
fix(android): remove How_To_Guides from toc
StaticRocket Jun 11, 2025
8646550
fix(TDA4VM): repair graphics entries
StaticRocket Jun 11, 2025
947d019
fix(android): remove old entries from toc
StaticRocket Jun 11, 2025
2eef6e1
fix(linux): remove old release toc entries
StaticRocket Jun 11, 2025
6fdfadd
fix(AM68A): repair cma toc tree entry
StaticRocket Jun 11, 2025
9f978d1
fix(AM62LX): remove invalid toc entry
StaticRocket Jun 11, 2025
869d0a2
fix(AM6*): remove invalid multimedia toc entry
StaticRocket Jun 11, 2025
f14c767
fix(TDA4VM): remove invalid Power_Management entry
StaticRocket Jun 11, 2025
c91ba41
fix(J784S4): fix typo in toc tree entry
StaticRocket Jun 11, 2025
1e11691
fix(TDA4VM): remove invalid toc entry
StaticRocket Jun 11, 2025
1f91688
fix(PRU-ICSS): remove invalid toc entries
StaticRocket Jun 11, 2025
b8e2538
fix(AM57X): repair pru toc tree entry
StaticRocket Jun 11, 2025
17c68ff
fix(CORESDK): remove invalid toc entry
StaticRocket Jun 11, 2025
bbb325e
fix(CPSW-TSN): repair toc tree entry
StaticRocket Jun 11, 2025
fff6ea7
ci(check_toc_txt): add a lock to prevent regression
StaticRocket Jun 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/check_toc_txt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: "check_toc_txt"

on:
pull_request:
branches: [master]
paths:
- 'source/**'
- 'configs/*/*_toc.txt'

defaults:
run:
shell: bash

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
container:
image: ghcr.io/texasinstruments/processor-sdk-doc:latest
options: --entrypoint /bin/bash

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update refs and settings
run: |
git config --global --add safe.directory "$PWD"
git switch -C pr
git fetch --no-tags --depth=1 origin master
git switch master

- name: Run rstcheck
run: |
# Disable color output
export NO_COLOR=true

# Run the test
bin/delta.sh -a master -b pr -- ./bin/check_toc_txt.py

# Prepare summary
WARNING_COUNT=$(wc -l < _new-warn.log)
if [ "$WARNING_COUNT" -gt "0" ]; then
echo "New issues found with check_toc_txt.py:"
echo '```text'
cat _new-warn.log
echo '```'
else
echo "No new issues found with check_toc_txt.py"
fi >> "$GITHUB_STEP_SUMMARY"

# Prepare the artifacts
mkdir -p ./results
echo "${{ github.event.number }}" > ./results/id
cp "$GITHUB_STEP_SUMMARY" ./results/summary
echo "$(wc -l < _new-warn.log)" > ./results/problem-count

# Exit with error if there are new warnings
[ "$WARNING_COUNT" -eq "0" ]

- name: Save results
uses: actions/upload-artifact@v4
if: always()
with:
name: results
path: results/
retention-days: 1
1 change: 1 addition & 0 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
workflow_run:
workflows:
- rstcheck
- check_toc_txt
types:
- completed

Expand Down
13 changes: 0 additions & 13 deletions bin/check-configs.sh

This file was deleted.

74 changes: 74 additions & 0 deletions bin/check_toc_txt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env python3

"""Tool to verify all files in the given toc are valid

SPDX-License-Identifier: MIT
Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com
"""

import argparse
import re
from pathlib import Path
import logging

CONFIG_PATH = Path("configs/")
SOURCE_PATH = Path("source/")
COMMENT_REGEX = re.compile(r"#.*")

logger = logging.getLogger(__name__)


def is_slug(slug):
"""Check to see if the given slug is valid. Assumes extension will be rst.

:param slug: String path slug
"""
path = SOURCE_PATH.joinpath(slug + ".rst")
logging.debug("Expanded slug: %s", path)
return path.is_file()


def process_toc_txt(path):
"""Process a single toc.txt file

:param path: Pathlib path to toc.txt
"""
with path.open("r", encoding="utf-8") as file:
logging.debug("Processing %s", path)
for line_number, line in enumerate(file):
clean_line = COMMENT_REGEX.sub("", line).strip()
if clean_line and not is_slug(clean_line):
logging.warning("Invalid slug: %s:%i %s", path, line_number + 1, clean_line)


def process_all():
"""Process all toc.txt files in the config directory"""
for path in CONFIG_PATH.glob("**/*toc.txt"):
if path.is_file():
process_toc_txt(path)


def main():
"""Main CLI entrypoint"""
parser = argparse.ArgumentParser(
prog="check_toc_txt.py",
description="Tool to verify all files in the given toc are valid",
)

parser.add_argument("-t", "--toc", type=Path)
parser.add_argument("-v", "--verbose", action="store_true")

args = parser.parse_args()
log_level = logging.DEBUG if args.verbose else logging.INFO
logging.basicConfig(level=log_level)

if args.toc:
if not args.toc.is_file():
logging.critical("Invalid toc.txt file specified")
process_toc_txt(args.toc)
else:
process_all()


if __name__ == "__main__":
main()
2 changes: 0 additions & 2 deletions configs/AM335X/AM335X_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ linux/Foundational_Components_Virtualization
linux/Foundational_Components/Virtualization/Docker
linux/Foundational_Components_Machine_Learning
linux/Foundational_Components/Machine_Learning/armnn
linux/Foundational_Components/Machine_Learning/tidl
linux/Foundational_Components/Machine_Learning/tflite
linux/Foundational_Components/Machine_Learning/tvm

linux/Foundational_Components/Graphics/index
linux/Foundational_Components/Graphics/Common/Display
Expand Down
3 changes: 0 additions & 3 deletions configs/AM437X/AM437X_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ linux/Release_Specific_Yocto_layer_Configuration
linux/Release_Specific_Supported_Platforms_and_Versions
linux/Foundational_Components
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -92,9 +91,7 @@ linux/Foundational_Components_Virtualization
linux/Foundational_Components/Virtualization/Docker
linux/Foundational_Components_Machine_Learning
linux/Foundational_Components/Machine_Learning/armnn
linux/Foundational_Components/Machine_Learning/tidl
linux/Foundational_Components/Machine_Learning/tflite
linux/Foundational_Components/Machine_Learning/tvm

linux/Foundational_Components/Graphics/index
linux/Foundational_Components/Graphics/Common/Display
Expand Down
14 changes: 6 additions & 8 deletions configs/AM57X/AM57X_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ devices/AM57X/linux/Release_Specific_Release_Notes
devices/AM57X/linux/Release_Specific
devices/AM57X/linux/Release_Specific_Yocto_layer_Configuration
devices/AM57X/linux/Release_Specific_Performance_Guide
linux/Release_Specific_Migration_Guide
linux/Release_Specific_Supported_Platforms_and_Versions
linux/Foundational_Components
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -57,11 +55,11 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/Network/NetCP
linux/Foundational_Components/Kernel/Kernel_Drivers/Network/PRUSS
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_End_Point
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_overview
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_dvfs
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_smartreflex
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_suspend_resume
linux/Foundational_Components_Power_Management
linux/Foundational_Components/Power_Management/pm_overview
linux/Foundational_Components/Power_Management/pm_dvfs
linux/Foundational_Components/Power_Management/pm_smartreflex
linux/Foundational_Components/Power_Management/pm_suspend_resume
linux/Foundational_Components/Kernel/Kernel_Drivers/PWM
linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI
linux/Foundational_Components/Kernel/Kernel_Drivers/SPI
Expand All @@ -82,7 +80,7 @@ linux/Foundational_Components/Tools/Development_Tools
linux/Foundational_Components/Tools/Flash_Tools
linux/Foundational_Components/Tools/Pin_Mux_Tools
linux/Foundational_Components/Tools/Code_Composer_Studio
linux/Foundational_Components_PRU-ICSS_PRU_ICSSG
linux/Foundational_Components_PRU_Subsystem
linux/Foundational_Components/PRU-ICSS-Linux-Drivers
linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RemoteProc
linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RPMsg
Expand Down
2 changes: 0 additions & 2 deletions configs/AM62LX/AM62LX_linux_toc.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
devices/AM62LX/index
devices/AM62LX/index_RTOS
devices/AM62LX/linux/Overview
devices/AM62LX/linux/Overview_Getting_Started_Guide
devices/AM62LX/linux/Overview/Download_and_Install_the_SDK
Expand Down Expand Up @@ -84,7 +83,6 @@ linux/Foundational_Components_Tools
linux/Foundational_Components/Tools/Development_Tools
linux/Foundational_Components/Tools/Pin_Mux_Tools
#linux/Foundational_Components/Tools/GPIO_Tools
linux/Foundational_Components_IPC62l
linux/Foundational_Components_Machine_Learning
linux/Foundational_Components/Machine_Learning/arm_compute_library
linux/Foundational_Components/Machine_Learning/armnn
Expand Down
2 changes: 0 additions & 2 deletions configs/AM65X/AM65X_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ devices/AM65X/linux/Release_Specific_Yocto_layer_Configuration
devices/AM65X/linux/Release_Specific_Migration_Guide
devices/AM65X/linux/Release_Specific_Performance_Guide
devices/AM65X/linux/Release_Specific_Supported_Platforms_and_Versions
devices/AM65X/linux/Release_Specific_QSG
linux/Foundational_Components
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down
6 changes: 2 additions & 4 deletions configs/AM67/AM67_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ devices/J7_Family/linux/Release_Specific_Yocto_layer_Configuration
devices/J7_Family/linux/Release_Specific_Migration_Guide
devices/J7_Family/linux/Release_Specific_Performance_Guide
devices/J7_Family/linux/Release_Specific_Supported_Platforms_and_Versions
devices/J7_Family/linux/Release_Specific_QSG
linux/Foundational_Components
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -60,8 +58,8 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-CBS
linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-IET
linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-TSN-Tuning
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_dfs
linux/Foundational_Components_Power_Management
linux/Foundational_Components/Power_Management/pm_dfs
linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI
linux/Foundational_Components/Kernel/Kernel_Drivers/SERDES/SERDES
linux/Foundational_Components/Kernel/Kernel_Drivers/SPI
Expand Down
7 changes: 2 additions & 5 deletions configs/AM67A/AM67A_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ devices/J7_Family/linux/Release_Specific_Yocto_layer_Configuration
devices/J7_Family/linux/Release_Specific_Migration_Guide
devices/J7_Family/linux/Release_Specific_Performance_Guide
devices/J7_Family/linux/Release_Specific_Supported_Platforms_and_Versions
devices/J7_Family/linux/Release_Specific_QSG
linux/Foundational_Components
linux/index_Edge_AI
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -61,8 +59,8 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-CBS
linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-IET
linux/Foundational_Components/Kernel/Kernel_Drivers/Network/CPSW-TSN-Tuning
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_dfs
linux/Foundational_Components_Power_Management
linux/Foundational_Components/Power_Management/pm_dfs
linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI
linux/Foundational_Components/Kernel/Kernel_Drivers/SERDES/SERDES
linux/Foundational_Components/Kernel/Kernel_Drivers/SPI
Expand All @@ -86,7 +84,6 @@ linux/Foundational_Components_Virtualization
linux/Foundational_Components/Virtualization/Docker
linux/Foundational_Components_OPTEE
linux/Foundational_Components_ATF
linux/Foundational_Components_Multimedia_Other_Tools
linux/Foundational_Components_Multimedia_wave5
linux/Foundational_Components/Graphics/index
linux/Foundational_Components/Graphics/Common/Display
Expand Down
6 changes: 2 additions & 4 deletions configs/AM68/AM68_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ devices/J7_Family/linux/Release_Specific_Yocto_layer_Configuration
devices/J7_Family/linux/Release_Specific_Migration_Guide
devices/J7_Family/linux/Release_Specific_Performance_Guide
devices/J7_Family/linux/Release_Specific_Supported_Platforms_and_Versions
devices/J7_Family/linux/Release_Specific_QSG
linux/Foundational_Components
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -65,8 +63,8 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_End_Point
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Backplane
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex
linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_dfs
linux/Foundational_Components_Power_Management
linux/Foundational_Components/Power_Management/pm_dfs
linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI
linux/Foundational_Components/Kernel/Kernel_Drivers/SERDES/SERDES
linux/Foundational_Components/Kernel/Kernel_Drivers/SPI
Expand Down
8 changes: 3 additions & 5 deletions configs/AM68A/AM68A_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ devices/J7_Family/linux/Release_Specific_Yocto_layer_Configuration
devices/J7_Family/linux/Release_Specific_Migration_Guide
devices/J7_Family/linux/Release_Specific_Performance_Guide
devices/J7_Family/linux/Release_Specific_Supported_Platforms_and_Versions
devices/J7_Family/linux/Release_Specific_QSG
linux/Foundational_Components
linux/index_Edge_AI
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -66,8 +64,8 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_End_Point
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Backplane
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex
linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_dfs
linux/Foundational_Components_Power_Management
linux/Foundational_Components/Power_Management/pm_dfs
linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI
linux/Foundational_Components/Kernel/Kernel_Drivers/SERDES/SERDES
linux/Foundational_Components/Kernel/Kernel_Drivers/SPI
Expand Down Expand Up @@ -128,7 +126,7 @@ linux/How_to_Guides/FAQ/How_to_Integrate_Open_Source_Software
linux/How_to_Guides/Host/How_to_Build_a_Ubuntu_Linux_host_under_VMware
linux/How_to_Guides_Hardware_Setup_with_CCS
linux/How_to_Guides/Hardware_Setup_with_CCS/AM68_SK_Hardware_Setup
linux/How_to_Guides/Target/How_To_Carve_out_CMA
linux/How_to_Guides/Target/How_To_Carve_Out_CMA

linux/Documentation_Tarball

Expand Down
6 changes: 2 additions & 4 deletions configs/AM69/AM69_linux_toc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ devices/J7_Family/linux/Release_Specific_Yocto_layer_Configuration
devices/J7_Family/linux/Release_Specific_Migration_Guide
devices/J7_Family/linux/Release_Specific_Performance_Guide
devices/J7_Family/linux/Release_Specific_Supported_Platforms_and_Versions
devices/J7_Family/linux/Release_Specific_QSG
linux/Foundational_Components
linux/Foundational_Components_U-Boot
linux/Foundational_Components/U-Boot/Release-Notes
linux/Foundational_Components/U-Boot/Users-Guide
linux/Foundational_Components/U-Boot/UG-General-Info
linux/Foundational_Components/U-Boot/UG-DFU
Expand Down Expand Up @@ -65,8 +63,8 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_End_Point
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Backplane
linux/Foundational_Components/Kernel/Kernel_Drivers/PCIe/PCIe_Root_Complex
linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management
linux/Foundational_Components/Kernel/Kernel_Drivers/Power_Management/pm_dfs
linux/Foundational_Components_Power_Management
linux/Foundational_Components/Power_Management/pm_dfs
linux/Foundational_Components/Kernel/Kernel_Drivers/QSPI
linux/Foundational_Components/Kernel/Kernel_Drivers/SERDES/SERDES
linux/Foundational_Components/Kernel/Kernel_Drivers/SPI
Expand Down
Loading
Loading