A powerful tool to extract, analyze, and visualize annotations in your source code.
extract_comments is a command-line tool that scans your code to extract special comments (TODO, FIXME, BUG, etc.) and generates detailed Markdown reports, interactive HTML dashboards, and JSON exports. It helps you track all your tasks and issues directly from your codebase.
- Smart extraction: Detects all important annotation types
- Rich metadata: Assignees, priorities, due dates, GitHub links
- Interactive HTML dashboard: Modern, filterable visualization
- Multi-branch reports: Automatically generates a report for each Git branch
- Flexible configuration: Via YAML/JSON config file or CLI options
- Folder exclusion: Easily ignore decorative or bulky folders
- PyInstaller compatibility: Works as a standalone binary
- CI/CD integration: Ready-to-use GitHub Actions workflow
No external dependencies required. Simply clone this repository:
git clone https://github.com/maelemiel/extract_comments.git
cd extract_commentsTo generate an executable:
make| Type | Emoji | Description | Default Priority |
|---|---|---|---|
| TODO | ✅ | Tasks to do | 2 |
| FIXME | 🚨 | Critical issues to fix | 1 |
| BUG | 🐛 | Known bugs | 1 |
| HACK | ⚙️ | Temporary solutions | 2 |
| NOTE | 📝 | Important notes | 3 |
| TEMP | 🕒 | Temporary code | 2 |
| IN PROGRESS | 🚧 | In progress | 2 |
| OPTIMIZE | ⚡ | Optimizations to make | 3 |
| REVIEW | 👀 | Code to review | 2 |
| QUESTION | ❓ | Questions to clarify | 2 |
| IDEA | 💡 | Ideas to explore | 3 |
./extract_comments --directory /path/to/projectusage: extract_comments [-h] [--directory DIRECTORY] [--output OUTPUT] [--json-output JSON_OUTPUT]
[--extensions EXTENSIONS ...] [--repo-url REPO_URL]
[--exclude EXCLUDE ...] [--simple] [--per-branch] [--config CONFIG]
options:
-h, --help Show help message
--directory, -d Directory to scan (default: current directory)
--output, -o Output Markdown file
--json-output, -j Output JSON file
--extensions, -e File extensions to scan
--repo-url, -r GitHub repository URL (for links)
--exclude, -x Folders to exclude
--simple, -s Generate a simplified report/dashboard
--per-branch Generate a report for each Git branch
--config, -c YAML or JSON configuration file
- Simplified report on a project:
./extract_comments -d ./myproject -s- Multi-branch report with HTML dashboard:
./extract_comments -d ./myproject --per-branch --simple- Using a configuration file:
./extract_comments -c config.yaml- Exclude decorative folders:
./extract_comments -d ./myproject -x node_modules tests examples- From a PyInstaller executable:
./dist/extract_comments --config config.yamlYou can define all options in a config.yaml or config.json file:
directory: ./myproject
output: ./docs/annotations.md
json_output: ./docs/annotations.json
exclude:
- node_modules
- tests
- examples
repo_url: https://github.com/username/myproject
simple: true
per_branch: trueCLI options override those in the config file.
- Basic syntax:
# TODO: Implement form validation// FIXME: Fix image loading- Add metadata:
# TODO: Optimize search @alice P1 DUE:2025-12-31 #42- Supported metadata:
@username: assigneeP1,P2, ...: priorityDUE:YYYY-MM-DD: due date#123: GitHub issueCREATED:YYYY-MM-DD: creation date
- Simplified Markdown: visual dashboard, urgent list, charts
- Detailed Markdown: statistics, grouped by type/priority, full metadata
- JSON: structured data for integration
- HTML: interactive dashboard (filtering, search, stats)
After extraction, a modern HTML dashboard is generated (filterable, interactive, ready to integrate into your docs or CI/CD).
Automate extraction with the provided workflow:
Contributions are welcome! Open an issue or a pull request.
Project under the MIT license. See the LICENSE file.
For any questions or suggestions, contact @maelemiel.