Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit ebfe6c8

Browse files
authored
Merge pull request #606 from ishanrai05/pylint-errors
Give detailed report of pylint test failures
2 parents e625127 + 1a649d0 commit ebfe6c8

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/python_lint.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,29 @@ jobs:
1616
uses: actions/setup-python@v2
1717
with:
1818
python-version: 2.7
19-
- name: Install and Pylint
19+
- name: Install Pylint
2020
run: |
2121
python2 -m pip install pylint
22-
- name: Lint with pylint
22+
- name: Generate error reports
2323
run: |
24-
pylint ${{ env.GIT_DIFF }}
24+
pylint --msg-template='{path}:{line:3d}:{column}: [{msg_id}] {msg} ({symbol})' --suggestion-mode=y --reports=y --disable=RP0101,RP0401,RP0402,RP0701,RP0801 ${{ env.GIT_DIFF }} | tee temp.txt
2525
if: env.GIT_DIFF
26+
- name: Parse output
27+
if: env.GIT_DIFF && github.event_name == 'pull_request'
28+
run: |
29+
cat temp.txt | sed -n '/Report/,$p' | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' > report.txt
30+
- name: Comment Test Coverage
31+
if: env.GIT_DIFF && github.event_name == 'pull_request'
32+
env:
33+
URL: ${{ github.event.pull_request.comments_url }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: |
36+
curl -X POST $URL \
37+
-H "Content-Type: application/json" -H \
38+
"Authorization: token $GITHUB_TOKEN" \
39+
--data '{ "body": "<pre>'"$(head -n 1 report.txt)"'</pre>" }'
40+
- name: Check warnings and errors
41+
run: |
42+
pylint --msg-template='{path}:{line:3d}:{column}: [{msg_id}] {msg} ({symbol})' --suggestion-mode=y --disable=all --enable=E,W ${{ env.GIT_DIFF }}
43+
if: env.GIT_DIFF
44+

0 commit comments

Comments
 (0)