Skip to content

fix: update github/codeql-action digest to 9d59969 #1086

fix: update github/codeql-action digest to 9d59969

fix: update github/codeql-action digest to 9d59969 #1086

Workflow file for this run

---
name: Code Linter
on:
pull_request:
branches:
- main
paths:
- '**.py'
- '**.yml'
- '**.yaml'
permissions:
checks: write
contents: write
jobs:
lint:
if: ${{ ! contains(github.repository, 'template') }}
runs-on: ubuntu-latest
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
files.pythonhosted.org:443
github.com:443
pypi.org:443
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Dependencies
uses: ./.github/actions/setup-poetry
with:
python-version: "3.10" # Due to pytype not supporting 3.11
- name: Run Poetry check
run: poetry check
- name: Run YAML linter
run: poetry run yamllint .
- name: Run Python autoflake
run: poetry run autoflake --recursive --check src test
- name: Run Python tryceratops
run: poetry run tryceratops src test
- name: Run Python docformatter
run: poetry run docformatter --recursive --check src test
- name: Run Python black
run: poetry run black --check src test
- name: Run Python interrogate
run: poetry run interrogate -c pyproject.toml src test
- name: Run Python ruff
run: poetry run ruff --no-fix --format github src test
- name: Run Python pytype
run: poetry run pytype src test
- name: Run reporters
run: |
echo "# Code condition report" >> $GITHUB_STEP_SUMMARY
echo "## Basic code statistics (radon)" >> $GITHUB_STEP_SUMMARY
echo "Class | Function | Method " >> $GITHUB_STEP_SUMMARY
echo "---|---|---" >> $GITHUB_STEP_SUMMARY
echo "C | F | M " >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Good | Bad | Worst " >> $GITHUB_STEP_SUMMARY
echo "---|---|---" >> $GITHUB_STEP_SUMMARY
echo "A | C | F " >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Maintainability Index" >> $GITHUB_STEP_SUMMARY
poetry run radon mi src >> $GITHUB_STEP_SUMMARY
echo "### Cyclomatic Complexity" >> $GITHUB_STEP_SUMMARY
poetry run radon cc --total-average src >> $GITHUB_STEP_SUMMARY
echo "## Cohesion levels (cohesion)" >> $GITHUB_STEP_SUMMARY
poetry run cohesion -d src >> $GITHUB_STEP_SUMMARY
echo "## Possibly dead code (vulture)" >> $GITHUB_STEP_SUMMARY
poetry run vulture src >> $GITHUB_STEP_SUMMARY || true
echo "## Advanced code statistics (radon)" >> $GITHUB_STEP_SUMMARY
echo "### Halstead Metrics" >> $GITHUB_STEP_SUMMARY
poetry run radon hal src >> $GITHUB_STEP_SUMMARY
echo "### Raw Metrics" >> $GITHUB_STEP_SUMMARY
poetry run radon raw src >> $GITHUB_STEP_SUMMARY