Add --language and --keyword flags for improved issue filtering#43
Add --language and --keyword flags for improved issue filtering#43kholoud512 wants to merge 10 commits intoyankeexe:masterfrom
Conversation
…uage and keywords
|
@yankeexe Thank you! |
- Add --language flag to filter issues by programming language - Add --keyword flag to filter issues by keywords in title - Both filters use case-insensitive matching - Display helpful messages when no results match filters - Show active filters in output for user clarity Resolves yankeexe#42
- Fix indentation of filter block (was causing syntax issues) - Update README and feature documentation - Ensure proper code formatting
dbf623e to
7d6716f
Compare
iamteamstar
left a comment
There was a problem hiding this comment.
Great progress on moving the arguments to search.py using Click! The CLI options and the README updates look perfect.
However, there is a critical logical bug in how the filtering is applied, specifically with the --language flag. I've left a comment on the exact lines, but essentially, the script is searching for the programming language inside the issue title, which won't work. Let's fix that filtering logic and we'll be good to go
|
|
||
| # Data Filtering | ||
| if mode == "org" or mode == "user": | ||
| if mode in ["org", "user"]: |
There was a problem hiding this comment.
While this works, a more 'Pythonic' and efficient way to filter lists is by using list comprehensions. You can reduce this entire block to a single line:
issues = [issue for issue in issues if keyword.lower() in issue[0].lower()]
| filtered_issues = [] | ||
| for issue in issues: | ||
| title = issue[0].lower() | ||
| if keyword.lower() in title: |
There was a problem hiding this comment.
Here, the code checks if the language string exists inside the issue title (issue[0]). Issue titles rarely mention the programming language (e.g., a title is usually 'Fix bug in login', not 'Fix bug in login Python'). Because of this, the language filter will almost always return an empty list.
Purpose of the change
At the moment, the CLI tool shows all “good first issues” without providing filters for language or topic.
This limitation makes it difficult for contributors to quickly locate issues relevant to their expertise or interests.
Introducing filtering options will make the tool more practical and efficient.
Overview of the implementation
This pull request introduces two additional command-line flags to enhance issue filtering capabilities:
--language: filters issues by programming language
--keyword: filters issues containing particular words in their titles or descriptions
These new options allow users to narrow down search results and easily find the most relevant issues.
After pulling the changes, run the tool with the new flags:
good-first-issues --language python
good-first-issues --keyword "api"
good-first-issues --language javascript --keyword "frontend"
✅ The output should display only the issues matching your filters.
Fixes Add filtering options for programming language and keyword search #42