-
Notifications
You must be signed in to change notification settings - Fork 362
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
chore: add pre-commit config, type hints, badges, and lint codebase #57
chore: add pre-commit config, type hints, badges, and lint codebase #57
Conversation
- Add .pre-commit-config.yaml and pyproject.toml for Black and isort - Add missing type hints throughout the code (Dict[...] for Python 3.8 compatibility) - Added badges and convert existing badges to use <a><img></a> format - Lint Markdown files - Lint Jinja templates with djlint
I have now resolved the errors and fixed additional type hint violations. |
Wow first thank you so much for this invaluable PR It was very needed and I'm wiling to merge ASAP |
@cyclotruc I identified the root cause of the issue in from clone import clone_repo to an absolute import: from gitingest.clone import clone_repo This modification caused two tests to fail, and I began investigating the reason behind this. Update: patch('clone.check_repo_exists', ...) to: patch('gitingest.clone.check_repo_exists', ...) After making this change, the tests passed successfully. I will make another commit and update my PR. |
@cyclotruc |
I realize that my initial commit would have been more effective if it had been divided into smaller, more focused commits. I hope this is still acceptable. |
Failed because of |
@cyclotruc |
…to resolve installation errors.
cb10135
to
2655278
Compare
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.
This is wonderful, I can't thank you enough for those much needed improvements
I read through every change and felt your attention to details
ParamSpec only exists from python 3.9 |
Please feel welcomed to contribute again About your future considerations: I don't know much about a pylint integration, but stronger static analysis could be helpful As for the docstring this is indeed a good idea that will benefit the API and the python package as well Feel free to reach out on Discord (or mail) if you want to discuss in more details the possible improvements we could work on |
Oh and Btw, shouldn't we trigger those actions via a github action as well? Unless I understood wrong, it's currently up to the user to run So I guess running those automatically in outstanding PRs could hint the contributors to run those |
Apologies. I can switch from |
To be honest I think it should be fine for a new project like this one but thank you for offering |
Of course, that's a valid suggestion. I preferred not to modify the CI testing setup without first coordinating with you. I'm happy to open a new pull request to integrate GitHub Actions for triggering those checks if you’d like. Additionally, encouraging contributors to run the |
Sure, please do! As for encouraging the contributors all I can think about is to improve the "contributions" part of the readme, do you think of anything else? |
Then we could also move over to use the new style type hints, e.g., |
You could also add a |
This sounds like a good idea please go ahead |
For this one I think I'll prefer to wait I want to have more experience with the eventual pains in the dev flow to see if a makefile is the best way to address them |
Summary
This PR introduces a variety of improvements to enhance code quality and consistency:
.pre-commit-config.yaml
andpyproject.toml
withblack
,isort
, anddjlint
.Dict[...]
for Python 3.8 compatibility.<a><img>
format for uniform styling.Future Considerations
darglint
to automate docstring checks.pylint
into thepre-commit
workflow for deeper static analysis.