Skip to content

Commit

Permalink
Provide requirements file and update linting workflow to use (pins li…
Browse files Browse the repository at this point in the history
…nting tool versions).
  • Loading branch information
jatkinson1000 committed Nov 19, 2024
1 parent a0c78ff commit 11c8e4d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m venv ftorch
. ftorch/bin/activate
python -m venv ftorch_venv
. ftorch_venv/bin/activate
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install fortitude-lint
pip install ruff
pip install -r requirements.txt
# Run CMake build to get compile commands for clang
- name: FTorch CMake
run: |
. ftorch/bin/activate
. ftorch_venv/bin/activate
export FT_DIR=$(pwd)
VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
export Torch_DIR=${VIRTUAL_ENV}/lib/python${VN}/site-packages
Expand All @@ -59,7 +58,7 @@ jobs:
if: always()
run: |
cd ${{ github.workspace }}
. ftorch/bin/activate # Uses .clang-tidy config file if present
. ftorch_venv/bin/activate # Uses .clang-tidy config file if present
fortitude check src/
# Apply C++ and C linter and formatter, clang
Expand All @@ -86,13 +85,13 @@ jobs:
if: always()
run: |
cd ${{ github.workspace }}
. ftorch/bin/activate
. ftorch_venv/bin/activate
fortitude check examples
- name: ruff
if: always()
run: |
cd ${{ github.workspace }}
. ftorch/bin/activate
. ftorch_venv/bin/activate
ruff format --diff ./
ruff check --diff ./
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ venv/
ENV/
env.bak/
venv.bak/
ftorch_venv/

# Spyder project settings
.spyderproject
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ruff==0.7.3
fortitude-lint
clang-format==19.1.3
clang-tidy==19.1.0

0 comments on commit 11c8e4d

Please sign in to comment.