spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
115 stars 61 forks source link

Autofix linting, and formatting updates #841

Closed BradleySappington closed 4 months ago

BradleySappington commented 4 months ago

Massive non functional ruff formatting/linting updates

pep8speaks commented 4 months ago

Hello @BradleySappington, Thank you for updating !

Line 19:1: E402 module level import not at top of file

Line 24:1: E402 module level import not at top of file Line 30:1: E402 module level import not at top of file Line 36:1: E402 module level import not at top of file Line 215:28: E203 whitespace before ':'

Line 5:1: E402 module level import not at top of file Line 7:1: E402 module level import not at top of file Line 8:1: E402 module level import not at top of file

Line 27:5: E722 do not use bare 'except'

Line 4:1: E266 too many leading '#' for block comment Line 35:1: E266 too many leading '#' for block comment Line 54:1: E266 too many leading '#' for block comment

Line 64:9: E266 too many leading '#' for block comment Line 111:9: E722 do not use bare 'except'

Line 542:5: E731 do not assign a lambda expression, use a def

Line 17:1: E266 too many leading '#' for block comment Line 58:1: E266 too many leading '#' for block comment Line 217:1: E266 too many leading '#' for block comment Line 291:1: E266 too many leading '#' for block comment

Line 1412:13: E722 do not use bare 'except'

Line 12:1: E266 too many leading '#' for block comment Line 187:5: E731 do not assign a lambda expression, use a def Line 291:15: W605 invalid escape sequence '\c' Line 297:51: W605 invalid escape sequence '\s'

Line 20:1: E266 too many leading '#' for block comment Line 184:1: E266 too many leading '#' for block comment Line 727:13: E722 do not use bare 'except' Line 876:71: E712 comparison to False should be 'if cond is False:' or 'if not cond:' Line 1307:52: E203 whitespace before ':' Line 1307:70: E203 whitespace before ':' Line 1892:9: E266 too many leading '#' for block comment

Line 23:1: E402 module level import not at top of file Line 288:63: E712 comparison to True should be 'if cond is True:' or 'if cond:'

Line 11:1: E402 module level import not at top of file Line 13:1: E402 module level import not at top of file

Line 9:1: E402 module level import not at top of file Line 11:1: E731 do not assign a lambda expression, use a def Line 12:1: E731 do not assign a lambda expression, use a def Line 13:1: E731 do not assign a lambda expression, use a def Line 15:1: E731 do not assign a lambda expression, use a def

Line 11:1: E402 module level import not at top of file Line 14:1: E402 module level import not at top of file Line 16:1: E731 do not assign a lambda expression, use a def Line 17:1: E731 do not assign a lambda expression, use a def Line 18:1: E731 do not assign a lambda expression, use a def Line 20:1: E731 do not assign a lambda expression, use a def

Line 12:1: E402 module level import not at top of file Line 14:1: E402 module level import not at top of file Line 16:1: E402 module level import not at top of file Line 17:1: E402 module level import not at top of file Line 20:1: E402 module level import not at top of file Line 22:1: E731 do not assign a lambda expression, use a def Line 23:1: E731 do not assign a lambda expression, use a def Line 24:1: E731 do not assign a lambda expression, use a def Line 26:1: E731 do not assign a lambda expression, use a def Line 28:1: E731 do not assign a lambda expression, use a def Line 29:1: E731 do not assign a lambda expression, use a def Line 193:5: E731 do not assign a lambda expression, use a def Line 251:5: E731 do not assign a lambda expression, use a def Line 388:21: E712 comparison to False should be 'if cond is False:' or 'if not cond:'

Line 10:1: E731 do not assign a lambda expression, use a def Line 11:1: E731 do not assign a lambda expression, use a def Line 12:1: E731 do not assign a lambda expression, use a def Line 14:1: E731 do not assign a lambda expression, use a def

Line 10:1: E402 module level import not at top of file Line 13:1: E402 module level import not at top of file Line 15:1: E731 do not assign a lambda expression, use a def Line 20:1: E731 do not assign a lambda expression, use a def Line 21:1: E731 do not assign a lambda expression, use a def Line 23:1: E731 do not assign a lambda expression, use a def

Line 180:36: E712 comparison to False should be 'if cond is False:' or 'if not cond:' Line 316:5: E731 do not assign a lambda expression, use a def

Line 182:5: E731 do not assign a lambda expression, use a def Line 185:5: E731 do not assign a lambda expression, use a def

Line 6:1: E722 do not use bare 'except' Line 14:1: E402 module level import not at top of file Line 15:1: E402 module level import not at top of file Line 46:5: E722 do not use bare 'except'

Line 10:1: E402 module level import not at top of file Line 12:1: E402 module level import not at top of file Line 13:1: E402 module level import not at top of file Line 218:5: E722 do not use bare 'except'

Line 44:34: W605 invalid escape sequence '\m' Line 1450:9: E266 too many leading '#' for block comment Line 1588:43: W605 invalid escape sequence '\m' Line 1589:40: W605 invalid escape sequence '\m' Line 1620:5: E722 do not use bare 'except' Line 1782:34: E262 inline comment should start with '# '

Line 88:9: E265 block comment should start with '# ' Line 90:9: E265 block comment should start with '# ' Line 91:9: E265 block comment should start with '# ' Line 97:9: E265 block comment should start with '# ' Line 273:25: E712 comparison to False should be 'if cond is False:' or 'if not cond:' Line 275:27: E712 comparison to True should be 'if cond is True:' or 'if cond:' Line 339:35: E203 whitespace before ':' Line 405:1: E266 too many leading '#' for block comment Line 612:5: E266 too many leading '#' for block comment Line 627:5: E266 too many leading '#' for block comment Line 662:5: E266 too many leading '#' for block comment Line 685:5: E266 too many leading '#' for block comment Line 839:5: E266 too many leading '#' for block comment Line 921:49: W605 invalid escape sequence '\D' Line 955:1: E266 too many leading '#' for block comment Line 984:43: E203 whitespace before ':' Line 1074:5: E722 do not use bare 'except' Line 1221:5: E266 too many leading '#' for block comment Line 1238:5: E266 too many leading '#' for block comment Line 1251:118: W605 invalid escape sequence '\D' Line 1538:5: E731 do not assign a lambda expression, use a def Line 1785:25: W605 invalid escape sequence '\D' Line 1793:1: E266 too many leading '#' for block comment Line 1872:9: E266 too many leading '#' for block comment Line 1900:13: E266 too many leading '#' for block comment Line 1920:9: E266 too many leading '#' for block comment

Line 16:1: E402 module level import not at top of file Line 23:1: E266 too many leading '#' for block comment Line 162:1: E266 too many leading '#' for block comment Line 390:5: E722 do not use bare 'except' Line 395:9: E722 do not use bare 'except' Line 403:46: E721 do not compare types, use 'isinstance()' Line 437:1: E266 too many leading '#' for block comment Line 535:33: E203 whitespace before ':' Line 535:50: E203 whitespace before ':' Line 536:43: E203 whitespace before ':' Line 536:60: E203 whitespace before ':' Line 636:1: E266 too many leading '#' for block comment

Line 700:1: E266 too many leading '#' for block comment Line 1692:13: E731 do not assign a lambda expression, use a def Line 1694:13: E731 do not assign a lambda expression, use a def Line 1713:9: E266 too many leading '#' for block comment Line 1736:9: E266 too many leading '#' for block comment Line 1737:9: E266 too many leading '#' for block comment

Comment last updated at 2024-05-09 15:10:40 UTC
BradleySappington commented 4 months ago

@mperrin and @obi-wan76 - The changes in these files have all been completed using ruff check . --autofix It should predominantly be formatting changes, and most of them are quote style changes. You shouldn't see any "highlighted" changes that look like logic changes in your review, and if you do we should discuss (I will also personally review everything).

This is the first of the code clean PRS and should be pretty straight forward.

BradleySappington commented 4 months ago

@mperrin and @obi-wan76 - I'm going to include one more commit with more auto-formatting changes for files that require manual intervention. That way, when I do the manual intervention, there wont be formatting changes mucking up the compare. I will tag you when ready for review (probably tomorrow)

BradleySappington commented 4 months ago

@mperrin and @obi-wan76 - Ready for review. Again, all of these changes were deemed the "safe" options for autoformat. I didn't include any "unsafe" changes, that will be a future PR. So this massive change set should be straightforward.

BradleySappington commented 4 months ago

FYI: I just went through all the code and feel comfortable with this change set.

BradleySappington commented 4 months ago

switching to new branch with different rules