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

Fix check-format.py to properly exclude modules in Mac OSX. #237

Closed s-mandra closed 4 years ago

alankao64 commented 4 years ago

Leaving Mac OSX checks to @alankao64.

Seems like check_format.sh now correctly ignores .cpp files in .gitmodules, but isn't catching incorrectly formatted python files in general.

s-mandra commented 4 years ago

Leaving Mac OSX checks to @alankao64.

Seems like check_format.sh now correctly ignores .cpp files in .gitmodules, but isn't catching incorrectly formatted python files in general.

I made different improvement to the script. Right now it should:

@alankao64, would you mind to test this script to make sure that it works on Mac OSX as well? Thanks!

alankao64 commented 4 years ago

Not sure if its just my Mac, but incorrectly formatted python files aren't being caught properly.

s-mandra commented 4 years ago

Strange .. it works properly on my Mac OS X workstation. Let me take a closer look.

s-mandra commented 4 years ago

There was an error that prevented Travis to properly check the format. Now everything works. However, I've noticed that yapf version is very important: indeed, different version still gives different formatting even if the style is kept fixed. I'm trying to address this problem by standardizing the required version.

alexandrupaler commented 4 years ago

yapf is a python module, and I tried to standardize its version in requirements.txt

s-mandra commented 4 years ago

yapf is a python module, and I tried to standardize its version in requirements.txt

Thanks! There is also a python module for clang-format, but it cannot install it on alpine ..

s-mandra commented 4 years ago

yapf is a python module, and I tried to standardize its version in requirements.txt

Thanks! There is also a python module for clang-format, but it cannot install it on alpine ..

Fixed. Now .travis.yml uses requirements.txt to determine the right version to install (through pip).

s-mandra commented 4 years ago

check_format.sh now requires yapf and clang-format to be the exact same version as reported in requirements.txt.