-
-
Notifications
You must be signed in to change notification settings - Fork 124
Add ability to register pipelines through a SCANCODEIO_PIPELINES_DIRS… #244
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
Conversation
… setting #237 Signed-off-by: Thomas Druez <tdruez@nexb.com>
|
@pombredanne could you have a look at the changes before the merge? |
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.
See my comments inline.
scanpipe/apps.py
Outdated
| pipeline_classes = inspect.getmembers(module, is_pipeline) | ||
|
|
||
| if len(pipeline_classes) > 1: | ||
| raise ImproperlyConfigured("Only 1 Pipeline class allowed per file.") |
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.
| raise ImproperlyConfigured("Only 1 Pipeline class allowed per file.") | |
| raise ImproperlyConfigured(f"Only one Pipeline class allowed per pipeline file: {path}.") |
|
|
||
| elif pipeline_classes: | ||
| pipeline_class = pipeline_classes[0][1] | ||
| self.register_pipeline(name=module_name, cls=pipeline_class) |
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.
Are we checking that the name is new and unique and does not mask the existing pipelines?
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.
Co-authored-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
… setting #237
Signed-off-by: Thomas Druez tdruez@nexb.com