Skip to content

Commit 3bc228e

Browse files
jstirnamanCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 18e9f7d commit 3bc228e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/remind-sync-docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
id: detect-changes
2424
run: |
2525
# Get list of changed README files
26-
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^influxdata/.*/README\.md$' | head -10)
26+
# Limit the number of changed README files to avoid excessive notifications and workflow resource usage
27+
CHANGED_FILES_LIMIT=10
28+
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^influxdata/.*/README\.md$' | head -$CHANGED_FILES_LIMIT)
2729
2830
if [[ -z "$CHANGED_FILES" ]]; then
2931
echo "No plugin README files changed"

validate_readme.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def validate_examples(content: str) -> List[str]:
104104
# Check for bash code examples
105105
bash_examples = re.findall(r'```bash(.*?)```', content, re.DOTALL)
106106
if len(bash_examples) < 2:
107-
errors.append(f"Should have at least 2 bash code examples (found {len(bash_examples)})")
107+
if len(bash_examples) < MIN_BASH_EXAMPLES:
108+
errors.append(f"Should have at least {MIN_BASH_EXAMPLES} bash code examples (found {len(bash_examples)})")
108109

109110
# Check for influxdb3 commands in examples
110111
has_create_trigger = any('influxdb3 create trigger' in ex for ex in bash_examples)
@@ -165,7 +166,8 @@ def validate_troubleshooting(content: str) -> List[str]:
165166
solution_count = section_content.count('**Solution:') + section_content.count('Solution:')
166167

167168
if issue_count < 2:
168-
errors.append("Troubleshooting should include at least 2 documented issues")
169+
if issue_count < MIN_TROUBLESHOOTING_ISSUES:
170+
errors.append(f"Troubleshooting should include at least {MIN_TROUBLESHOOTING_ISSUES} documented issues")
169171
if issue_count > solution_count:
170172
errors.append("Each troubleshooting issue should have a corresponding solution")
171173

@@ -238,7 +240,7 @@ def validate_readme(readme_path: Path) -> Tuple[List[str], List[str]]:
238240

239241
# Check for optional but recommended sections
240242
for section in OPTIONAL_SECTIONS:
241-
if section not in content and section not in ["### Debugging tips", "### Performance considerations"]:
243+
if section not in content and section not in IGNORED_OPTIONAL_SECTIONS:
242244
warnings.append(f"Consider adding '{section}' section")
243245

244246
# Check for template remnants

0 commit comments

Comments
 (0)