indy-node icon indicating copy to clipboard operation
indy-node copied to clipboard

Formatting with Black?

Open dbluhm opened this issue 3 years ago • 4 comments

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.

dbluhm avatar Feb 16 '22 19:02 dbluhm

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

WadeBarnes avatar Feb 16 '22 20:02 WadeBarnes

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

pSchlarb avatar Feb 21 '22 16:02 pSchlarb

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.

dbluhm avatar Feb 21 '22 18:02 dbluhm

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?

pSchlarb avatar Jun 23 '22 09:06 pSchlarb