Skip to content

fix: update github/codeql-action digest to af56b04 #1002

fix: update github/codeql-action digest to af56b04

fix: update github/codeql-action digest to af56b04 #1002

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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- 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