Commit Graph

16 Commits

Author SHA1 Message Date
Pierre-Yves David
3ecb1c614d config: register the 'devel.servercafile' config 2017-06-28 13:32:07 +02:00
Pierre-Yves David
7549dc1c0e config: register the 'devel.disableloaddefaultcerts' config 2017-06-28 13:31:18 +02:00
Pierre-Yves David
5f7946e0d0 config: register the 'devel.check-relroot' config 2017-06-28 13:31:05 +02:00
Pierre-Yves David
67ce915060 config: register the devel.check-locks config 2017-06-28 13:37:59 +02:00
Pierre-Yves David
7d6eacd5de config: register the 'devel.bundle2.debug' config
Existing explicit default are dropped now that the default is centralised.
2017-06-28 13:25:33 +02:00
Pierre-Yves David
36c29ec68d config: register the 'devel.all-warnings' config
Let us start registering the existing option. I'm starting with the 'devel'
section because it is full of useful things that are poorly documented. So
registering these will more than other section.
2017-06-28 13:19:40 +02:00
Pierre-Yves David
8eb6764bad configitems: support callable as a default value
Yuya pointed out that using mutable value as the default could be problematic.
To work around this we now support callable object as default value. This
allows for creating new mutable objects on demand when needed.
2017-06-28 13:50:20 +02:00
Pierre-Yves David
6b9d408177 configitems: add a devel warning for extensions items overiding core one
We do not want such case to pass silently. In the future we'll likely have
useful tool for an extension to alter the existing definition in core.
2017-06-18 19:52:54 +02:00
Pierre-Yves David
1dab0bbe74 configitems: add an official API for extensions to register config item
Extensions can have a 'configtable' mapping and use
'registrar.configitem(table)' to retrieve the registration function.

This behave in the same way as the other way for extensions to register new
items (commands, colors, etc).
2017-06-17 13:48:20 +02:00
Pierre-Yves David
2305d6b487 configitems: extract the logic to build a registrar on any configtable
Having the logic available independently from the mapping used is a necessary
step toward extensions support.
2017-06-17 13:38:53 +02:00
Pierre-Yves David
e2366ea12d configitems: register 'ui.interactive'
That item default value is a bit special (None) so this adds a second proof
that everything is still working fine.
2017-06-23 17:19:29 +02:00
Pierre-Yves David
8f6dde9279 configitems: register 'ui.clonebundleprefers' as example for 'configlist'
This exercise the default value handling in 'configlist'.
2017-06-17 13:25:42 +02:00
Pierre-Yves David
414fa65e17 configitems: register 'patch.fuzz' as first example for 'configint'
This exercise the default value handling in 'configint'.
2017-06-17 13:17:10 +02:00
Pierre-Yves David
101a7d166c configitems: register 'ui.quiet' as first example
We now have a user and this works fine.
2017-06-17 12:33:59 +02:00
Pierre-Yves David
ba2fa929d4 configitems: introduce a central registry for config option
We now have the appropriate infrastructure to register config items. Usage will
added in the next changeset.
2017-06-17 18:43:27 +02:00
Pierre-Yves David
5371837b9e configitems: add a basic class to hold config item information
The goal of this class is allow explicit declaration for the available config
option. This class will hold the data for one specific config item.

To keep it simple we start centralizing the handling of the default config value.

In the future we can expect more data to be carried on this class. For example:
 - documentation,
 - status (experimental, advanced, normal, deprecated),
 - aliases,
 - expected type,
 - etc...
2017-06-17 18:41:55 +02:00