Skip to content

Commit

Permalink
do not warn on - in refs (#15920)
Browse files Browse the repository at this point in the history
* do not warn on - in refs

* Update conans/model/recipe_ref.py

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
  • Loading branch information
memsharded and AbrilRBS authored Mar 25, 2024
1 parent 077ec0c commit dbb80bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions conans/model/recipe_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def validate_ref(self, allow_uppercase=False):
if self.channel and validation_pattern.match(self.channel) is None:
raise ConanException(f"Invalid package channel '{self.channel}'")

# Warn if they use .+- in the name/user/channel, as it can be problematic for generators
pattern = re.compile(r'[.+-]')
# Warn if they use .+ in the name/user/channel, as it can be problematic for generators
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

0 comments on commit dbb80bd

Please sign in to comment.