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

do not warn on - in refs #15920

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conans/model/recipe_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def validate_ref(self, allow_uppercase=False):
raise ConanException(f"Invalid package channel '{self.channel}'")

# Warn if they use .+- in the name/user/channel, as it can be problematic for generators
memsharded marked this conversation as resolved.
Show resolved Hide resolved
pattern = re.compile(r'[.+-]')
pattern = re.compile(r'[.+]')
if pattern.search(self.name):
ConanOutput().warning(f"Name containing special chars is discouraged '{self.name}'")
if self.user and pattern.search(self.user):
Expand Down
4 changes: 2 additions & 2 deletions conans/test/integration/command/export/export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ def test_warn_special_chars_refs():
assert "WARN: Name containing special chars is discouraged 'pkg.name'" in c.out
c.run("export . --name=name --version=0.1 --user=user+some")
assert "WARN: User containing special chars is discouraged 'user+some'" in c.out
c.run("export . --name=pkg.name --version=0.1 --user=user --channel=channel-some")
assert "WARN: Channel containing special chars is discouraged 'channel-some'" in c.out
c.run("export . --name=pkg.name --version=0.1 --user=user --channel=channel+some")
assert "WARN: Channel containing special chars is discouraged 'channel+some'" in c.out


def test_export_json():
Expand Down