From 7618d960485e6bd21f2ec50eba6bcc534cbb2235 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 17 Dec 2021 11:42:54 -0500 Subject: [PATCH] Fix cargo fmt call in tox.ini This commit updates the lint job definition in the tox.ini to work now that we have workspaces in the rust package. In #459 we added a new workspace for the dedicated rust package retworkx-core. But having workspaces means that running cargo fmt outside from the tests/ directory (as we do with tox) means cargo doesn't know which workspace to run against. To correct this issue this commit adds the --all flag to the cargo fmt call in the tox job definition to ensure we're able to run from any directory in the repo and check the formatting on all the rust files in the project. --- .github/workflows/main.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da25ce56da..8128564507 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: - name: Test Build run: cargo build - name: Rust Format - run: cargo fmt -- --check + run: cargo fmt --all -- --check - name: Clippy run: cargo clippy -- -D warnings - name: Black Codestyle Format diff --git a/tox.ini b/tox.ini index 8813154332..dbaa2d2b76 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,7 @@ whitelist_externals=cargo commands = black --check --diff {posargs} '../retworkx' '../tests' flake8 --per-file-ignores='../retworkx/__init__.py:F405,F403' ../setup.py ../retworkx . - cargo fmt -- --check + cargo fmt --all -- --check [testenv:docs] basepython = python3