Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 9 additions & 3 deletions .github/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -59,7 +65,7 @@ is_special_carrier() {
}
```

#### 4. Required sections
#### 5. Required sections

- **Main board README** MUST contain:
- `Building the project`
Expand All @@ -80,7 +86,7 @@ Include these flags on the first line of the README.md file, as a MarkDown comme
<!-- no_build_example, no_dts, no_no_os -->
```

#### 5. Forbidden content
#### 6. Forbidden content

- Links to the following are not allowed:
- `https://wiki.analog.com/resources/tools-software/linux-drivers-all`
Expand Down
27 changes: 23 additions & 4 deletions .github/scripts/check_readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down