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

Get rid of the double config nesting #7956

Open
sschuberth opened this issue Nov 29, 2023 · 3 comments
Open

Get rid of the double config nesting #7956

sschuberth opened this issue Nov 29, 2023 · 3 comments
Labels
configuration About configuration topics enhancement Issues that are considered to be enhancements

Comments

@sschuberth
Copy link
Member

          Note to myself: Let's [discuss later](https://github.com/oss-review-toolkit/ort/wiki/Kotlin-Developer-Meeting#2023-10-30) if this class could be inlined to get rid of the double `config` nesting.

Originally posted by @sschuberth in #7690 (comment)

@sschuberth sschuberth added enhancement Issues that are considered to be enhancements configuration About configuration topics labels Nov 29, 2023
@sschuberth
Copy link
Member Author

sschuberth commented Nov 29, 2023

Due to the recent refactoring, this now requires rather ugly constructs like

ortResult.scanner?.config?.config?.get("DOS")?.options?.get("frontendUrl")

The proposal is to either "inline" the nested config by moving it one level up, or to rename it to e.g. plugins, so it would read

ortResult.scanner?.config?.plugins?.get("DOS")?.options?.get("frontendUrl")

/cc @Etsija

@mnonnenmacher
Copy link
Member

mnonnenmacher commented Nov 29, 2023

I would be in favor of renaming config to plugins. In addition I would suggest to add helper functions that make it easier to get the plugin configuration especially from scripts like the evaluator rules. Some ideas:

ortResult.getPluginConfig<ScannerWrapper>("ScanCode"): PluginConfiguration?
ortResult.scanner.getPluginConfig("ScanCode"): PluginConfiguration?
ortResult.scanner.getScannerWrapperConfig("ScanCode"): PluginConfiguration?

@sschuberth
Copy link
Member Author

I would be in favor of renaming config to plugins.

Yeah, I also believe the name makes sense as the values in that map are always of type PluginConfiguration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration About configuration topics enhancement Issues that are considered to be enhancements
Projects
None yet
Development

No branches or pull requests

2 participants