Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quick suggestions for include/exclude patterns #45

Conversation

ScottWilliamAnderson
Copy link

@ScottWilliamAnderson ScottWilliamAnderson commented Dec 23, 2024

Related to #44

Add quick suggestions feature to easily amend include/exclude parameters.

  • In src/gitingest/ingest_from_query.py:

    • Add generate_suggestions function to analyze repository and identify common file patterns.
    • Implement check_relevance function to check the relevance of each suggestion.
    • Add sort_suggestions function to sort suggestions based on the number of files or total lines affected.
  • In src/gitingest/cli.py:

    • Add new --suggestions option to display quick suggestions for include/exclude patterns.
    • Update main function to include suggestions in the output.
  • In src/gitingest/parse_query.py:

    • Add normalize_user_added_patterns function to normalize user-added patterns.
    • Add check_user_added_matches_suggestions function to check if user-added patterns match any suggestions.
  • In src/gitingest/tests/test_ingest.py:

    • Add tests for generate_suggestions, check_relevance, and sort_suggestions functions.
  • In src/static/js/utils.js:

    • Add toggleSuggestion function to handle adding/removing suggestions by clicking.
    • Add displaySuggestions function to display suggestions in the web interface.

For more details, open the Copilot Workspace session.

Related to cyclotruc#44

Add quick suggestions feature to easily amend include/exclude parameters.

* **In `src/gitingest/ingest_from_query.py`**:
  - Add `generate_suggestions` function to analyze repository and identify common file patterns.
  - Implement `check_relevance` function to check the relevance of each suggestion.
  - Add `sort_suggestions` function to sort suggestions based on the number of files or total lines affected.

* **In `src/gitingest/cli.py`**:
  - Add new `--suggestions` option to display quick suggestions for include/exclude patterns.
  - Update `main` function to include suggestions in the output.

* **In `src/gitingest/parse_query.py`**:
  - Add `normalize_user_added_patterns` function to normalize user-added patterns.
  - Add `check_user_added_matches_suggestions` function to check if user-added patterns match any suggestions.

* **In `src/gitingest/tests/test_ingest.py`**:
  - Add tests for `generate_suggestions`, `check_relevance`, and `sort_suggestions` functions.

* **In `src/static/js/utils.js`**:
  - Add `toggleSuggestion` function to handle adding/removing suggestions by clicking.
  - Add `displaySuggestions` function to display suggestions in the web interface.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/cyclotruc/gitingest/issues/44?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link
Author

@ScottWilliamAnderson ScottWilliamAnderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor edits needed

@@ -1,25 +1,17 @@
// Copy functionality

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remove the existing comments in this file

Copy link
Owner

@cyclotruc cyclotruc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I like this idea of suggestions, this implementation is not ready to merge.
Unit tests are not passing and I couldn't make it work when I tried the CLI

I see that you used AI to generate this code and this is okay. This project draws in people interested in AI coding and I believe it's a great opportunity to experiment and learn together.

That being said, I think you should test your code a bit more to maybe understand why It didn't work when I tried it

relevant_suggestions = []
base_path = query['local_path']
for suggestion in suggestions:
if should_include(base_path, base_path, [suggestion]):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base_path, base_path doesn't use should_include properly

document.addEventListener('DOMContentLoaded', () => {
initializeSlider();
setupGlobalEnterHandler();
});

function toggleSuggestion(suggestion) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion should not appear in front-end?

@ScottWilliamAnderson
Copy link
Author

@cyclotruc Thank you for reviewing!
I was just testing out workspaces on mobile as I'm OOO for the holidays and don't have a machine to run a dev environment. It seems useful at first glance, but not nearly ready for implementing full features.

I'm afraid I won't be able to make a good PR for #44, I'm happy to close this and just keep the feature request open. Let me know in case you'd like me to reopen this PR.

All the best!
Scott

@cyclotruc
Copy link
Owner

It's all good, the issue will help us frame the discussion and so this helps already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants