ngnrsaa / qflex

Flexible Quantum Circuit Simulator (qFlex) implements an efficient tensor network, CPU-based simulator of large quantum circuits.
Apache License 2.0
97 stars 24 forks source link

check_format.sh not catching incorrectly formatted python files. #239

Closed alankao64 closed 4 years ago

alankao64 commented 4 years ago

Incorrectly formatted python files aren't being caught in check_format.sh, yet when manually running YAPF, they are shown as incorrectly formatted.

alankao64 commented 4 years ago

Seems like line 72 in check_format.sh is the issue: if [[ $(${PY_CHECKER} -d "$filename" | wc -l) > 0 ]]; then I don't think its catching when the wordcount is over 0.

95-martin-orion commented 4 years ago

It should be possible to use the error code returned by yapf --diff <filename> instead of checking the size of the diff. From the YAPF docs:

If --diff is supplied, YAPF returns zero when no changes were necessary, non-zero otherwise

alexandrupaler commented 4 years ago

This could be due to different yapf versions? There is a system wide yapf and a local one in the venv environment?

alankao64 commented 4 years ago

Seems to have been resolved with PR #237