-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update code style #31
Commits on Jan 8, 2024
-
Remove undesirable pre-commit checks
We use print statements for console output, so shouldn't run flake8-print. We run black as part of pre-commit already, so don't need to run flake8-black. We can safely ignore the following flake8 checks: - S105: We don't use any passwords, so don't need to check for them. - E203: flake8 and black disagree on how to format [x : y] Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bfe79c0 - Browse repository at this point
Copy the full SHA bfe79c0View commit details -
Add compatibility options to pre-commit hooks
black and isort both require explicit line lengths for compatibility with flake8's default length of 79 characters. isort additionally needs to be told to use black-compatible formatting. Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fe65833 - Browse repository at this point
Copy the full SHA fe65833View commit details -
Re-order pre-commit checks to minimize passes
With the original order, it was possible for files to fail the pre-commit multiple times. For example, running black may introduce a new multi-line statement that add-trailing-comma couldn't adjust (because it ran first). The new order tries to group hooks to update: 1) Formatting-independent syntax 2) Statement order 3) Formatting 4) Formatting-dependent syntax Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0edd372 - Browse repository at this point
Copy the full SHA 0edd372View commit details -
Run new pre-commit hooks on all files
This commit enforces the new formatting, but does nothing to address any of the errors raised by the new linter. Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ccebb31 - Browse repository at this point
Copy the full SHA ccebb31View commit details -
Remove imported but unused modules
F401 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 26b7b79 - Browse repository at this point
Copy the full SHA 26b7b79View commit details -
Rename variables with ambiguous names
E741 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 55b488c - Browse repository at this point
Copy the full SHA 55b488cView commit details -
Fix f-string with missing placeholders
F541 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cf9544e - Browse repository at this point
Copy the full SHA cf9544eView commit details -
Fix reference to undefined name "ParserError"
F821 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for adbf6b2 - Browse repository at this point
Copy the full SHA adbf6b2View commit details -
Move module level imports to top of file
E402 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d3a1768 - Browse repository at this point
Copy the full SHA d3a1768View commit details -
Use isinstance instead of comparing types
E721 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2631149 - Browse repository at this point
Copy the full SHA 2631149View commit details -
Replace '%' operator with f-strings
FS001 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bacdf2d - Browse repository at this point
Copy the full SHA bacdf2dView commit details -
Replace usage of '.format' with f-strings
FS002 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6765eaa - Browse repository at this point
Copy the full SHA 6765eaaView commit details -
Manually wrap some lines to 79 characters
E501 Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5300ba5 - Browse repository at this point
Copy the full SHA 5300ba5View commit details -
Remove comments used to disable old hooks
Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for df852a5 - Browse repository at this point
Copy the full SHA df852a5View commit details -
Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2e3c66f - Browse repository at this point
Copy the full SHA 2e3c66fView commit details -
Ignore F401 in __init__.py files
F401 is 'Module imported but unused'. Ignoring F401 for all __init__.py files seems like a cleaner solution than introducing unnecessary references to the modules (e.g. via __all__ or similar). Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ca465f2 - Browse repository at this point
Copy the full SHA ca465f2View commit details -
Use matplotlib functions consistently
Signed-off-by: John Pennycook <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3d55e51 - Browse repository at this point
Copy the full SHA 3d55e51View commit details