-
Notifications
You must be signed in to change notification settings - Fork 991
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
Make user confs have at leats one :
separator
#15296
Make user confs have at leats one :
separator
#15296
Conversation
…n they don't and it's scoped
("user.foo:bar=1", None), | ||
("user.baz=1", "'user.baz' must have at least one ':' separator"), | ||
]) | ||
def test_conf_scope_patterns_battery(conf, assert_message): |
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.
Failing test, fixing it now
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.
Looking good, just a couple of details
@RubenRBS From my point of view, the changes to be made should be something like this: diff --git a/conans/model/conf.py b/conans/model/conf.py
index 4a46d91ec..45f1d4000 100644
--- a/conans/model/conf.py
+++ b/conans/model/conf.py
@@ -116,9 +116,9 @@ BUILT_IN_CONFS = {
BUILT_IN_CONFS = {key: value for key, value in sorted(BUILT_IN_CONFS.items())}
-CORE_CONF_PATTERN = re.compile(r"^core[.:]")
-TOOLS_CONF_PATTERN = re.compile(r"^tools[.:]")
-USER_CONF_PATTERN = re.compile(r"^user[.:]")
+CORE_CONF_PATTERN = re.compile(r"^(core\..+|core):.*")
+TOOLS_CONF_PATTERN = re.compile(r"^(tools\..+|tools):.*")
+USER_CONF_PATTERN = re.compile(r"^(user\..+|user):.*")
def _is_profile_module(module_name):
@@ -496,8 +496,9 @@ class Conf:
@staticmethod
def _check_conf_name(conf):
if USER_CONF_PATTERN.match(conf) is None and conf not in BUILT_IN_CONFS:
- raise ConanException(f"[conf] '{conf}' does not exist in configuration list. "
- f" Run 'conan config list' to see all the available confs.")
+ raise ConanException(f"[conf] Either '{conf}' does not exist in configuration list or "
+ f"the conf format introduced is not valid. Run 'conan config list' "
+ f"to see all the available confs.") I think that this should cover everything 😁 UPDATED: I just updated the pattern 😅 |
Changelog: Bugfix: Ensure
user
confs have at least 1:
separatorChangelog: Fix: Fix
user
confs package scoping when no separator was givenDocs: Omit
Fix comes from trying to fix error messages when they disdnt have a
:
but were scoped