-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SOAR15334]- Updated email validator to show a warning if the example…
… did not match [SOAR15334]- Updated setup and README file [SOAR15334]- Fix typo
- Loading branch information
1 parent
727a74f
commit afd5edd
Showing
3 changed files
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
from icon_validator.rules.validator import KomandPluginValidator | ||
from icon_validator.exceptions import ValidationException | ||
from icon_validator.styling import * | ||
|
||
|
||
class ConfidentialValidator(KomandPluginValidator): | ||
|
@@ -25,6 +26,7 @@ def validate_help(plugin_path: str): | |
# Check content line by line for emails that validate the rule | ||
@staticmethod | ||
def validate_emails(content: [str], path_to_file: str): | ||
print(content) | ||
email_pattern = re.compile(r"([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+){0,}") | ||
for i in range(0, len(content)): | ||
matches = email_pattern.findall(content[i]) | ||
|
@@ -33,8 +35,8 @@ def validate_emails(content: [str], path_to_file: str): | |
for match in matches: | ||
user_email_pattern = re.compile(r"user\d*\@example.com") | ||
if not user_email_pattern.search(match): | ||
ConfidentialValidator.violations.append(f"{path_to_file}, line: {i + 1}") | ||
|
||
print( | ||
f"{YELLOW}WARNING: Email does not match recommended example [email protected]") | ||
# Search code base | ||
@staticmethod | ||
def validate_code(plugin_path: str): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters