Skip to content

Commit

Permalink
✨ adding mypy json output
Browse files Browse the repository at this point in the history
  • Loading branch information
MaaniBeigy committed Aug 11, 2024
1 parent 5a9b2a0 commit d27ee78
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .logs/mypy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mypy_result": "Success"
}
16 changes: 12 additions & 4 deletions .shell/mypy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ $mypy_result = Select-String -Path ".logs/mypy.txt" -Pattern 'Success' | ForEach
$_ -replace ':', ''
}

# Output the mypy result (for verification)
# Create an object to store the mypy_result in JSON format
$jsonOutput = @{
mypy_result = $mypy_result
} | ConvertTo-Json

# Save the JSON output to a file
$jsonOutput | Set-Content -Path ".logs/mypy.json"

# Output the lint score (for verification)
Write-Output "mypy_result: $mypy_result"

# Remove the old mypy.svg file
Remove-Item -Path "assets/images/mypy.svg" -Force -Recurse
# 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
# $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
Binary file removed assets/images/mypy.svg
Binary file not shown.

0 comments on commit d27ee78

Please sign in to comment.