-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cef617f
commit 2b82580
Showing
30 changed files
with
721 additions
and
722 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Find and delete files named 'mypy.txt' | ||
Get-ChildItem -Path . -Recurse -Filter 'mypy.txt' | Remove-Item -Force | ||
|
||
# Find and delete files named 'mypy.svg' | ||
Get-ChildItem -Path . -Recurse -Filter 'mypy.svg' | Remove-Item -Force | ||
|
||
# Run mypy using poetry and save the output to a log file | ||
poetry run mypy --config-file pyproject.toml ./ | Tee-Object -FilePath ".logs/mypy.txt" | ||
|
||
# Extract the mypy result from the log file | ||
$mypy_result = Select-String -Path ".logs/mypy.txt" -Pattern 'Success' | ForEach-Object { | ||
$_.Line -split ' ' | Select-Object -First 1 | ||
} | ForEach-Object { | ||
$_ -replace ':', '' | ||
} | ||
|
||
# Output the mypy result (for verification) | ||
Write-Output "mypy_result: $mypy_result" | ||
|
||
# Remove the old mypy.svg file | ||
Remove-Item -Path "assets/images/mypy.svg" -Force -Recurse | ||
|
||
# Generate the mypy badge using pybadges and save it to a file | ||
$command = "poetry run python -m pybadges --left-text='mypy' --right-color='brightgreen' --right-text=$mypy_result --embed-logo >> assets/images/mypy.svg" | ||
Invoke-Expression $command |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Find and delete files named 'pylint-log.txt' | ||
Get-ChildItem -Path . -Recurse -Filter 'pylint-log.txt' | Remove-Item -Force | ||
|
||
# Find and delete files named 'pylint.svg' | ||
Get-ChildItem -Path . -Recurse -Filter 'pylint.svg' | Remove-Item -Force | ||
|
||
# Run pylint using poetry and save the output to a log file | ||
poetry run pylint pycvcqv | Tee-Object -FilePath ".logs/pylint-log.txt" | ||
|
||
# Extract the lint score from the log file | ||
$lintscore = Select-String -Path ".logs/pylint-log.txt" -Pattern 'rated at' | ForEach-Object { | ||
$_.Line -split ' ' | Select-Object -Index 6 | ||
} | ForEach-Object { | ||
$_ -split '/' | Select-Object -First 1 | ||
} | ||
|
||
# Output the lint score (for verification) | ||
Write-Output "lintscore: $lintscore" | ||
|
||
# Generate the pylint badge using anybadge and save it to a file | ||
$command = "poetry run python -m anybadge -o --value=$lintscore --file=assets/images/pylint.svg pylint" | ||
Invoke-Expression $command |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Read the JSON file content | ||
$jsonContent = Get-Content -Path ".logs/safety.json" -Raw | ||
|
||
# Parse the JSON content | ||
$jsonObject = $jsonContent | ConvertFrom-Json | ||
|
||
# Extract the value | ||
$vulnerabilities_found = $jsonObject.report_meta.vulnerabilities_found | ||
|
||
# Output the value | ||
Write-Output $vulnerabilities_found | ||
|
||
# Remove the old vulnerabilities.svg file | ||
Remove-Item -Path "assets/images/vulnerabilities.svg" -Force -Recurse | ||
|
||
# Run the Python command using poetry and the extracted value | ||
# Note: Make sure 'poetry' and 'python3' are in your system's PATH | ||
$command = "poetry run python -m pybadges --left-text='vulnerabilities' --right-text='$vulnerabilities_found' --left-color='#40aef9' --right-color='#0c2739' --logo=assets/images/safety.png --embed-logo >> assets/images/vulnerabilities.svg" | ||
Invoke-Expression $command |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.