hyperledger / indy-node

The server portion of a distributed ledger purpose-built for decentralized identity.
https://wiki.hyperledger.org/display/indy
Apache License 2.0
685 stars 657 forks source link

Formatting with Black? #1736

Open dbluhm opened 2 years ago

dbluhm commented 2 years ago

In other python projects in the Hyperledger Ecosystem, black is used to help keep coding style consistent. I think Node would benefit from a similar treatment. This would however mean that we would need to essentially reformat every file in the project which is less than ideal. I think the improved formatting would be worth it but I'm interested to hear thoughts from others.

WadeBarnes commented 2 years ago

We'd want to do this for node and plenum. I'm in support of the proposal.

pSchlarb commented 2 years ago

Does it make sense, to incorporate that into the pipeline? https://github.com/rickstaa/action-black/

dbluhm commented 2 years ago

I am in favor of adding a format checker to the pipeline; this is how ACA-Py does it. If there are issues, it doesn't automatically commit reformatting so the original author has to fix formatting themselves. I personally favor this approach over any auto-commits from the pipeline.

pSchlarb commented 2 years ago

Currently the ubtunu-20.04 branches for plenum, node and sovrin token-plugin use the indy-shared-gha linting process from here. It is currently using flake8 in with the following versions: flake8==3.8.4 pep8==1.7.1 pep8-naming==0.6.1 The token-plugin is also linted with the updated versions of those. Should we use the existing one and upgrade the definitions? Or switch to black?