pico-project-generator icon indicating copy to clipboard operation
pico-project-generator copied to clipboard

Code Cleanup

Open Cabalist opened this issue 3 years ago • 4 comments

Hey there,

Just started using this. I noticed that files writes were not using a contextmanager and then fell down the rabbit hole of cleaning up some other things. Nothing should be a functional change and the with open(...) as ... will prevent any dangling filehandlers should an issue happen.

Each commit should be self contained to the issue it addresses for review instead of seeing a huge amount of thrash.

Ignoring whitespace in the compare is also helpful to cut down on the noise. :)

Cheers! Thanks for an awesome project!

Cabalist avatar Mar 12 '21 05:03 Cabalist

Can you post the functional changes as a separate PR please. Also, I disagree with some of the whitespace changes, there was formatting in there for a reason. Hence separating from the functional changes.

JamesH65 avatar Mar 12 '21 10:03 JamesH65

Done. New PR opened (#33)

As for the purposeful whitespace formatting, I see https://github.com/raspberrypi/pico-project-generator/blob/3a1cdad69a2218549547af2f31600b000930ab27/pico_project.py#L47-L62 Are there any other places were whitespace has purpose/meaning that were overwritten?

Cabalist avatar Mar 12 '21 17:03 Cabalist

I'll have to check again, that was the obvious example.

JamesH65 avatar Mar 12 '21 17:03 JamesH65

Has this been superseded by #39 ?

lurch avatar Sep 02 '21 09:09 lurch