Skip to content

Commit

Permalink
Fix cargo fmt call in tox.ini
Browse files Browse the repository at this point in the history
This commit updates the lint job definition in the tox.ini to work now
that we have workspaces in the rust package. In Qiskit#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.
  • Loading branch information
mtreinish committed Dec 17, 2021
1 parent 7da6749 commit 7618d96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7618d96

Please sign in to comment.