Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 azdev/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
text: azdev linter --repo azure-cli --tgt upstream/master --src upstream/dev
"""

helps['scan'] = """
helps['scan'] = r"""
short-summary: Scan secrets for files or string
long-summary: Check built-in scanning rules at https://github.com/microsoft/security-utilities/blob/main/GeneratedRegexPatterns/PreciselyClassifiedSecurityKeys.json
examples:
Expand Down
4 changes: 2 additions & 2 deletions azdev/operations/cmdcov/cmdcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def _run_command_test_coverage(self):
self.command_test_coverage['Total'][0] += count
self.command_test_coverage['Total'][1] += len(self.all_untested_commands[module])
self.command_test_coverage['Total'][2] = f'''{self.command_test_coverage["Total"][0] /
(self.command_test_coverage["Total"][0] +
self.command_test_coverage["Total"][1]):.3%}'''
(self.command_test_coverage["Total"][0] +
self.command_test_coverage["Total"][1]):.3%}'''
logger.warning(self.command_test_coverage)
return self.command_test_coverage

Expand Down
6 changes: 3 additions & 3 deletions azdev/operations/linter/rules/help_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@


# 'az' space then repeating runs of quoted tokens or non quoted characters
_az_pattern = 'az\s*' + '(([^\"\'])*|' + '((\"[^\"]*\"\s*)|(\'[^\']*\'\s*))' + ')' # noqa: W605
_az_pattern = r'az\s*' + '(([^\"\'])*|' + r'((\"[^\"]*\"\s*)|(\'[^\']*\'\s*))' + ')'
# match the two types of command substitutions
_CMD_SUB_1 = re.compile("\$\(\s*" + "(" + _az_pattern + ")" + "\)") # noqa: W605
_CMD_SUB_2 = re.compile("`\s*" + "(" + _az_pattern + ")" + "`") # noqa: W605
_CMD_SUB_1 = re.compile(r"\$\(\s*" + "(" + _az_pattern + ")" + r"\)")
_CMD_SUB_2 = re.compile(r"`\s*" + "(" + _az_pattern + ")" + "`")

logger = get_logger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions azdev/operations/tests/test_scan_and_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_scan_file(self):
self.assertEqual(len(result['scan_results'][simple_string_file]), 1)
self.assertEqual(result['scan_results'][simple_string_file][0]['secret_name'], 'AdditionalPattern')

regex_pattern1 = RegexPattern('(?<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,})', '000', 'EmailAddress')
regex_pattern1 = RegexPattern(r'(?<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,})', '000', 'EmailAddress')
regex_pattern2 = RegexPattern('(?i)(?:^|[?;&])(?:dsas_secret|sig)=(?<refine>[0-9a-z\\/+%]{43,129}(?:=|%3d))', '001', 'LooseSasSecret')
with mock.patch("azdev.operations.secret._load_built_in_regex_patterns", return_value=(regex_pattern1, regex_pattern2)):
result = scan_secrets(file_path=info_json_file)
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_mask(self):
custom_pattern = {
"Include": [
{
"Pattern": "(?<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,})",
"Pattern": r"(?<refine>[\w.%#+-]+)(%40|@)([a-z0-9.-]*.[a-z]{2,})",
"Name": "EmailAddress"
}
]
Expand Down
32 changes: 16 additions & 16 deletions azure-pipelines-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.8'
displayName: 'Use Python 3.12'
inputs:
versionSpec: 3.8
versionSpec: 3.12

- task: Bash@3
displayName: 'Run Wheel Build Script'
Expand All @@ -57,9 +57,9 @@ jobs:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.8'
displayName: 'Use Python 3.12'
inputs:
versionSpec: 3.8
versionSpec: 3.12

- task: Bash@3
displayName: 'Run Wheel Build Script'
Expand All @@ -80,10 +80,10 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python312:
python.version: '3.12'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
Expand Down Expand Up @@ -137,10 +137,10 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python312:
python.version: '3.12'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python312:
python.version: '3.12'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
Expand Down Expand Up @@ -201,10 +201,10 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python312:
python.version: '3.12'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
Expand Down Expand Up @@ -233,10 +233,10 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python312:
python.version: '3.12'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
Expand Down Expand Up @@ -264,10 +264,10 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python312:
python.version: '3.12'
steps:
- task: DownloadPipelineArtifact@1
displayName: 'Download Build'
Expand Down
13 changes: 8 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ jobs:
name: 'pool-ubuntu-2004'
strategy:
matrix:
Python38:
python.version: '3.8'
tox_env: 'py38'
Python39:
python.version: '3.9'
tox_env: 'py39'
Python310:
python.version: '3.10'
tox_env: 'py310'
Python311:
python.version: '3.11'
tox_env: 'py311'
Python312:
python.version: '3.12'
tox_env: 'py312'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
Expand Down Expand Up @@ -85,9 +88,9 @@ jobs:
name: 'pool-ubuntu-2004'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.8'
displayName: 'Use Python 3.12'
inputs:
versionSpec: 3.8
versionSpec: 3.12

- task: Bash@3
displayName: 'Run Wheel Build Script'
Expand Down