ft/data_source_bases #25
Workflow file for this run
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
name: Pylint Check | |
on: | |
pull_request: | |
branches: | |
- dev | |
- main | |
workflow_dispatch: | |
jobs: | |
pylint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install pylint | |
run: pip install pylint | |
- name: Run pylint | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
export PYLINT_SCORE=$(pylint src/ | grep 'Your code has been rated at' | awk '{print $7}' | cut -d '/' -f 1) | |
if (( $(echo "$PYLINT_SCORE < 9.5" | bc -l) )); then | |
echo "Pylint score is too low: $PYLINT_SCORE. Minimum required: 9.5" | |
gh pr comment \ | |
${{ github.event.pull_request.number }} \ | |
--body "$(envsubst < .github/not_enough_pylint_score.md)" | |
exit 1 | |
else | |
echo "Pylint score is $PYLINT_SCORE. Passed!" | |
fi |