Listing of tools and core configurations - #8821
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
| if item is None: | ||
| # TODO: Provide a helper | ||
| result += "\n[conf]\n" | ||
| result += self.app.cache.new_config.dumps() + "\n" |
There was a problem hiding this comment.
No, this is not the feature. It is not about listing current configuration.
It is about listing all possible configurations that are in our codebase, together with an explanation/documentation of what it does. Kind of conan --help for commands, but for configurations. Could be in conan config --help, for example, or conan config list.
At some point we might use it to validate user inputs, to avoid typos, for example.
There was a problem hiding this comment.
We don't populate new_config, we just read if a key is present or not. For example:
We will need to centralize them and populate with empty values.
There was a problem hiding this comment.
Centralize their definition:
confs = {
"core.required_conan_version": "help for this config",
"tools.microsoft.....": "help for this one too",
}Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
|
@memsharded I've added a new subcommand: I also collected all core and tools key for new_config. However, it's a bit fragile, because all developers when adding a new key, need to remember about DEFAULT_CONFIGURATION too. Another option is populating ConfDefinition with default values + help, but still we can't avoid people adding new keys, but not updating ConfDefinition. The current output is: |
Yes, I know. We should don't forget now in code reviews. But we should remind to document them anyway, so at least let's start to build the DB now, we could add later checks/validation against this DB (so people adding new confs without adding them here will raise) |
memsharded
left a comment
There was a problem hiding this comment.
Looks good, minor fixes, lets try to merge it for Conan 1.36
Signed-off-by: Uilian Ries <uilianries@gmail.com>
|
@memsharded All done, please, review again. |
|
Docs PR: conan-io/docs#2077 |
Some points need to be defined yet:
For global printing (conan config get), we can group conan.conf, global.conf and profile[conf] at same output.
However, get single item, update and adding a new one is more complicated. So far
conan configonly managesconan.conffile. We will need to support a new argument, like--global.Also, we can't print all possible configurations to be used by [conf], because
ConfDefitionis empty, and all items are read when a specific condition occurs. We would need to centralize all configuration again, just like we did for conan.conf, but I'm sure if we want it.Another point, we have 3 configurations, conan.conf, global.conf and profile[conf]. Printing all this is a mess, we could create a new layer to abstract them, otherwise we would need called separately. See line 629
Changelog: Feature: List tools and core from profile and global.conf.
Docs: conan-io/docs#2077
closes #8696
developbranch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.