diff --git a/.github/scripts/README.md b/.github/scripts/README.md index 0d16ef0702..2be7a85f0a 100644 --- a/.github/scripts/README.md +++ b/.github/scripts/README.md @@ -32,7 +32,13 @@ This script ensures that all HDL project directories contain properly formatted - **Board names** are uppercased and underscores are replaced with hyphens (e.g., `ad9081_fmca_ebz` → `AD9081-FMCA-EBZ`); - **Carrier names** are uppercased as-is (e.g., `de10nano` → `DE10NANO`), except for special carriers. -#### 3. Special carrier exceptions +#### 3. Special projects exceptions + +The following projects are allowed to use exceptions from the template in their project/README file: + +- `xcvr_wizard` + +#### 4. Special carrier exceptions The following carriers are allowed to use underscore in their README titles and are not flagged for title mismatches: @@ -59,7 +65,7 @@ is_special_carrier() { } ``` -#### 4. Required sections +#### 5. Required sections - **Main board README** MUST contain: - `Building the project` @@ -80,7 +86,7 @@ Include these flags on the first line of the README.md file, as a MarkDown comme ``` -#### 5. Forbidden content +#### 6. Forbidden content - Links to the following are not allowed: - `https://wiki.analog.com/resources/tools-software/linux-drivers-all` diff --git a/.github/scripts/check_readme.sh b/.github/scripts/check_readme.sh index 27c4570937..f6822fc5d3 100644 --- a/.github/scripts/check_readme.sh +++ b/.github/scripts/check_readme.sh @@ -34,6 +34,18 @@ is_special_carrier() { esac } +# Function to detect special projects (e.g., projects that need title check skipped) +is_special_project() { + case "$1" in + xcvr_wizard) + return 0 + ;; + *) + return 1 + ;; + esac +} + # Function to extract flags from first line of README extract_flags() { local file=$1 @@ -72,9 +84,16 @@ check_readme() { echo "$flags" | grep -q "$1" } - # Check title (skip for special carriers) - if [ "$is_main_readme" -eq 0 ] && is_special_carrier "$carrier"; then - : + # Check title (skip for special carriers or special projects) + if [ "$is_main_readme" -eq 0 ]; then + if is_special_carrier "$carrier" || is_special_project "$board"; then + : + else + if ! grep -q "$expected_title" "$file"; then + echo " ✖ Incorrect or missing title. Expected: $expected_title" + local_fail=1 + fi + fi else if ! grep -q "$expected_title" "$file"; then echo " ✖ Incorrect or missing title. Expected: $expected_title" @@ -89,7 +108,7 @@ check_readme() { local_fail=1 fi fi - if ! grep -q "Supported parts" "$file"; then + if ! grep -q "Supported parts" "$file" && ! is_special_project "$board"; then echo " ✖ Missing section \"Supported parts\"" local_fail=1 fi