-
Notifications
You must be signed in to change notification settings - Fork 546
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
feat(cli): Add support for multiple file exclusions and .gitingestignore file : issue #147 #150
Conversation
… and .gitingestignore support - Added the ability to specify multiple file exclusion patterns using the `-e` option. - Introduced support for a `.gitingestignore` file to define files and directories to be excluded. - Improved command line pattern parsing to handle space-separated patterns. - Combined exclusion patterns from both command line arguments and the `.gitingestignore` file for comprehensive exclusion. - Removed the unused import 'os' to satisfy pylint checks. - Corrected docstring issues to comply with darglint requirements. - Updated documentation with clear examples illustrating the new features. These enhancements provide users with a more flexible and user-friendly way to exclude files and directories, either through command line options or by using a `.gitingestignore` file.
@cyclotruc please review this PR. |
@cyclotruc do you have any changes to suggest for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal for gitingest is to provide the exact same behaviour when it's accessed from the web or from the CLI
In that regard, it would be wise to apply this ignore pattern logic also when a .gitingestignore file is included is found in the repo from the web UI
@AbhiRam162105 Thank you for this contribution! I requested a change and I'll be happy to merge this PR once it's done But I want to warn you that this file might be a temporary feature, there's in fact the project to create a When this happens, we'll throw a depreciation warning when this file is used, until we finally make the move to I thought about naming this file |
Hey @cyclotruc I have made changes such that .gitingestignore file method for file exclusion works with both CLI and when it's used from the web. Now if the .gitingestignore file exists in the repository the file is parsed in both cases and exclusion the files occurs in both CLI and web. Please review the code and feel free to continue with .gitingestignore file until the .gitignore file method is in the works. |
Hey @cyclotruc any updates on this pull request ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AbhiRam162105 , Sorry for the delay, finally got time to take a look at this PR
I appreciate the effort but unfortunatly, I don't think this implementation went in the right way, the last changes introduced some unecessary complexity that I want to avoid
I see repository cloning in the query_parser, it doesn't seem to be the right place to do that
Instead, you should just apply the parsed patterns from the .gitingestignore file to the parsed_query and then let the rest of the app handle the rest as usual
Let me know if you have any question or need help
okay @cyclotruc I'll look into this |
… logic and enhancing ignore pattern handling
Hey @cyclotruc I have avoided this complication by modifying query_processor.py file where the repo is already being cloned instead of cloning it again in query_parser.
|
Can you please review the code again @cyclotruc and if all is well - merge it. Let me know if anything else in the code is posing a problem. |
@cyclotruc why is the CI test failing. Maybe this could resolve the issue- By setting the `[project] [project.scripts] [project.urls] [build-system] [tool.setuptools] Linting configuration[tool.pylint.format] [tool.pylint.'MESSAGES CONTROL'] [tool.pycln] [tool.isort] [tool.black] Test configuration[tool.pytest.ini_options] Is this the right way to do this. Any insight regarding this from you would be helpful. |
@AbhiRam162105 Hi, So i've started looking into this PR and I must continue tomorrow, there's quite a lot of changes and I'm not sure I understand everything as of right now Regarding the CI tests failing, to fix them you can run |
Oh, I just noticed, it seems to be a test not passing Could you invite me to your repo so I can see if I can help you fix those? Thanks a lot |
@cyclotruc I have sent you an invite to my repo. Thank you for the help :) |
…e pattern handling in query parser
@cyclotruc i guess now the tests should pass. I have setup pre-commit and pytest ran error free |
Hey @cyclotruc can you please review this. Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello
Unfortunatly, I won't be able to merge this PR in its current state.
It's actually not easy and very time consuming to precisely tell you what's wrong with it, but in a gist:
I suspect some of this code to be AI generated, there are weird patterns that introduce unecessary complexity into the codebase. validate_patterns
or create context
functions are good examples of that.
I'm very sorry because I know that I am the one who asked you to add things to this PR when it was in an "OK" state. I can provide you more feedback if needed, you have my discord
@AbhiRam162105
To give you guidance here's what this Pr should do (and it shouldn't take many lines changes): Either way, I apologize for pushing back this review (the complexity made it daunting for me) and I appreciate the efforts you put into this. I would have been happy to merge it Maybe the solution would be to hop on a quick call together and peer-code it together? |
Hey @cyclotruc I am sorry to hear that. But yes we can hop on a call and get this done. I'll text you on discord regarding this and finish this because ideally I would not want to leave the work incomplete after working on this for so long. |
I'm closing this in favor of: #191 |
Enhanced CLI and Web Features: Multiple File Exclusion using CLI and .gitingestignore file
Description:
This PR significantly improves the
gitingest
CLI tool by introducing three major features:1. Support for Multiple Exclusion Patterns
-e
option.gitingest -e "LICENSE README.md package.json"
2. .gitingestignore File Support
.gitingestignore
file to specify files and directories to be ignored..gitingestignore
file follows a format similar to.gitignore
:.gitingestignore
file are combined for comprehensive exclusion..gitingestignore
file in the cloned repository3. Branch Selection Support
-b/--branch
option.Changes Made:
CLI Updates:
--branch/-b
option--exclude-pattern/-e
and--include-pattern/-i
options--ignore-file
option with default value.gitingestignore
Core Functionality:
ingest
function to handle branch selectionDocumentation:
Impact:
These enhancements make the
gitingest
CLI more flexible and user-friendly by:Issue Addressed:
Usage Examples:
Note: The
.gitingestignore
file functionality works seamlessly with both gitingest cli and gitingest website, making it a versatile tool for managing file exclusions regardless of the repository location.