ucam-department-of-psychiatry / crate

Create and use de-identified research databases. Preprocess, extract text, anonymise/de-identify, link, apply natural language processing, query for research, manage consent for contact.
GNU General Public License v3.0
19 stars 7 forks source link

Format the entire Python code with Black and check formatting #80

Closed martinburchell closed 2 years ago

martinburchell commented 2 years ago

@RudolfCardinal I don't think you really want to review 240 changed files so I'm going to just merge this and hope nothing is broken. The most likely breakages are going to be where I've chopped up strings not to exceed 80 characters.

A couple of things to note:

Fixes #76

martinburchell commented 2 years ago

I've diffed with temporary-black-branch, which has just the reformatting to see the PEP8 and tool changes following the reformat and I think it looks OK. The thing I'm most concerned about is accidentally turning a string into a tuple by changing"very long string" into ("very long string",) instead of ("very long string").

There's a bit of an iterative workflow should the specimen python config files change. We need to format them as Black would inside the comment block, run the generate docs script and then run black --line-length 79 --diff on the generated python files to check we haven't missed anything.