-
Notifications
You must be signed in to change notification settings - Fork 2
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: add parsers support #97
Conversation
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.
A very nice change of architecture towards having extractors and parsers. Clear naming and flow.
My suggestions would be:
- to decouple the parser from a file finder
- decouple the graph making from the parsing (as we decoupled the extraction from the graph making)
Here is a summary of new changes:
|
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.
Nothing more to say: I really like how you chose to implement my suggestions and I find it makes the whole much more modular.
Really nice! ⭐
This PR adds a new "Parser" interface that can parse file contents into triples. It also migrates the existing license detection code into a parser.
This required semantic changes throughout the code, to replace "source" by "git provider" to avoid confusion.
The PR does the following:
gimie.source
->gimie.extractors
Parser
interfaceLicenseParser
Project
and make it compatible withParser
sgimie data
The important changes are in
gimie/project.py
,gimie/parsers
andgimie/cli.py
.Implementing a new Parser is as simple as defining a subclass in
gimie.parsers
(and adding it to PARSERS):Example usage of parsers on the command line :