Skip to content

Conversation

@Sayyed-Arslaan
Copy link

This pull request fixes a bug in the rtl_ltr_linter.py script where lines containing both an opening (<div>) and a closing (</div>) tag were not processed correctly.

The original code used a continue statement after handling the opening <div> tag, which caused the script to immediately skip to the next line, ignoring the closing </div> tag on the same line. This fix removes the unnecessary continue statement, allowing the linter to correctly process both tags and maintain the correct state of the block context stack.

Closes #12430
Closes #12500

### Summary

This pull request introduces a new Python script, `scripts/alphabetical_order_linter.py`, to automatically check for alphabetical order violations within the project's Markdown lists.

### Problem

The repository's contributing guidelines require all lists to be in alphabetical order. With thousands of entries, it is very difficult for maintainers to manually verify this rule for every pull request, leading to inconsistencies.

### Solution

This script automates the validation process. It scans `.md` files in key directories (`books`, `courses`, `more`, `casts`) and:

1.  Identifies list items and extracts their titles.
2.  Compares each item with the previous one to ensure alphabetical order.
3.  Reports any violations with the filename, line number, and the conflicting lines.
4.  Exits with a non-zero status code if errors are found, making it ideal for integration into CI/CD workflows (like GitHub Actions).

This tool will help maintain the quality of the lists and significantly reduce the manual review effort for maintainers.

**How to use:**
```bash
python scripts/alphabetical_order_linter.py
Removed handling for opening <div> tags with markdown attribute.
@Ajay-singh1 Ajay-singh1 added the keep Requests exempt from being punctually stale label Oct 16, 2025
@github-actions github-actions bot added the conflicts Conflict(s) need to be resolved label Oct 16, 2025
@github-actions
Copy link

Oh no 😟! Conflicts have been found.

Please 🙏, take a moment and address the merge conflicts of your pull request before we can evaluate it again.

Thanks in advance for your effort and patience ❤️!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts Conflict(s) need to be resolved keep Requests exempt from being punctually stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: lint_file() fails to process lines containing both opening and closing <div> tags Fix: Correct <div> tag handling in rtl_ltr_linter.py

2 participants