Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Virashu committed Jul 25, 2024
1 parent 31ac668 commit 064e587
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
run: |
basedpyright $(git ls-files '*.py') > reports/pyright_report.txt || true
pyright_errors=$(basedpyright $(git ls-files '*.py') --outputjson | jq '.summary.errorCount')
echo ${pyright_errors} > pyright_errors.txt
if [ ${pyright_errors} -eq 0 ]; then
pyright_color="green"
Expand All @@ -51,8 +52,8 @@ jobs:
echo '{
"schemaVersion": 1,
"label": "Typing issues",
"message": "${pyright_errors}",
"color": "${pyright_color}"
"message": "'"${pyright_errors}"'",
"color": "'"${pyright_color}"'"
}' > pyright_badge.json
# Pylint
Expand All @@ -64,6 +65,7 @@ jobs:
run: |
pylint ./y > reports/pylint_report.txt || true
pylint_score=$(pylint -f json2 ./y | jq '.statistics.score')
echo ${pylint_score} > pylint_score.txt
if [ ${pylint_score} -gt 8 ]; then
pylint_color="green"
Expand All @@ -75,11 +77,19 @@ jobs:
echo '{
"schemaVersion": 1,
"label": "Typing issues",
"message": "${pylint_score}/10",
"color": "${pylint_color}"
"label": "Pylint score",
"message": "'"${pylint_score}"'/10",
"color": "'"${pylint_color}"'"
}' > pylint_badge.json
# Combine
- name: Combine results
run: |
echo '{
"pyright_errors": '"$(cat pyright_errors.txt)"',
"pylint_score": '"$(cat pylint_score.txt)"',
}' > lint.json
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -94,6 +104,7 @@ jobs:
name: nightly
tag_name: nightly
files: |
lint.json
pylint_badge.json
pyright_badge.json
reports/*
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Like 𝕏, but 𝕐.
<a href="https://github.com/virashu/y/releases/download/nightly/pylint_report.txt"><img alt="Dynamic JSON Badge" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2FVirashu%2FY%2Freleases%2Fdownload%2Fnightly%2Flint.json&query=%24.pylint_score&style=flat&label=Pylint%20score"></a>
<a href="https://github.com/virashu/y/releases/download/nightly/pyright_report.txt"><img alt="Dynamic JSON Badge" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2FVirashu%2FY%2Freleases%2Fdownload%2Fnightly%2Flint.json&query=%24.pyright_errors&style=flat&label=Typing%20issues&color=red"></a>

<img alt="Endpoint Badge" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fgithub.com%2Fvirashu%2Fy%2Freleases%2Fdownload%2Fnightly%2Fpylint_report.txt">



</center>

## Installation
Expand Down

0 comments on commit 064e587

Please sign in to comment.