facultyai / faculty-sync

Synchronise a local directory with your Faculty platform workspace
https://pypi.org/project/faculty_sync/
Apache License 2.0
10 stars 1 forks source link

Format Python source #35

Closed srstevenson closed 5 years ago

srstevenson commented 5 years ago

This was achieved using black --line-length 79 --skip-string-normalization, to best match the existing conventional code style (lines fewer than 80 characters long, and single quoted rather than double quoted strings), whilst ensuring formatting consistency.

pbugnion commented 5 years ago

Thanks for this.

Somewhat annoyingly, by removing trailing whitespaces in a string literal, this has broken the tests. When you print a table, any content in the last column has to be right-padded so the column has the same width.

Maybe writing the tests like this might help:

"a  b \n"
"c  d \n"
...
pbugnion commented 5 years ago

Separately, I'm not wedded to single quotes. I'm happy to switch to double quotes for consistency with other ASI projects.

srstevenson commented 5 years ago

@pbugnion PTAL: I've made the tests not dependent on the trailing whitespace in the manner you suggested, and also converted from single to double quoted strings.

janfreyberg commented 5 years ago

@srstevenson Public transport accessibility level?

janfreyberg commented 5 years ago

My only request would be to add format checks to the travis job, but that's something that can be done later

srstevenson commented 5 years ago

@srstevenson Public transport accessibility level?

"Please take a(nother) look."

srstevenson commented 5 years ago

My only request would be to add format checks to the travis job, but that's something that can be done later

Agreed, I'll submit an additional PR to add a formatting check to the Travis CI build.