allow usage of underscore in external libraries rules (#8)

* allow usage of underscore in external libraries rules

* iterate the name string with index (correct review comment)

sorry for autoformatting changes; the real changes are in lines 259, 260

* iterate the name string with index (correct review comment)
This commit is contained in:
irengrig 2018-08-06 15:20:29 +02:00 committed by GitHub
parent 7792e40fc0
commit 44c0c97846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -249,8 +249,10 @@ def _check_file_name(var, name):
if (not var[0:1].isalpha()):
fail("{} should start with a letter.".format(name.capitalize()))
if (not var.isalnum()):
fail("{} should be alphanumeric.".format(name.capitalize()))
for index in range(1, len(var) - 1):
letter = var[index]
if not letter.isalnum() and letter != '_':
fail("{} should be alphanumeric or '_'.".format(name.capitalize()))
_Outputs = provider(
doc = "Provider to keep different kinds of the external build output files and directories",