Skip to content

Cleaning code! (#782) #355

Cleaning code! (#782)

Cleaning code! (#782) #355

Workflow file for this run

name: Lint Source
on: [push, pull_request, workflow_dispatch]
jobs:
file-changes:
name: Detect File Changes
runs-on: 'ubuntu-latest'
outputs:
checkall: ${{ steps.changes.outputs.checkall }}
steps:
- name: Clone
uses: actions/checkout@v4
- name: Detect Changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: ".github/file-filter.yml"
lint-source:
name: Lint Source
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- name: Initialize MFC
run: ./mfc.sh init
- name: Lint the full source
run: |
source build/venv/bin/activate
find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \;
find ./src -type f -not -name '*nvtx*' -exec fortitude check {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0'
- name: No double precision intrinsics
run: |
! grep -iR 'double_precision\|dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" --exclude="*precision_select*" ./src/*
- name: Looking for junk code
run: |
! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/*
- name: Looking for junk comments in examples
run: |
! grep -R '# ===' ./benchmarks **/*.py
! grep -R '# ===' ./examples/**/*.py
! grep -R '===' ./benchmarks/**/*.py
! grep -R '===' ./examples/**/*.py