Skip to content
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

Clean up pylint (other than consider-using-f-string) #187

Closed
csatt opened this issue Jan 21, 2023 · 0 comments
Closed

Clean up pylint (other than consider-using-f-string) #187

csatt opened this issue Jan 21, 2023 · 0 comments
Assignees
Labels
cosmetic Code cleanup, etc.

Comments

@csatt
Copy link
Owner

csatt commented Jan 21, 2023

Pylint has new checks that need to be cleaned up. The most prevalent is consider-using-f-string. Since that will result in such a large number of changes, it will be better to fix all the other warnings first. This Issue is to fix all the pylint warnings EXCEPT the consider-using-f-string warnings.

@csatt csatt added the cosmetic Code cleanup, etc. label Jan 21, 2023
@csatt csatt self-assigned this Jan 21, 2023
csatt added a commit that referenced this issue Jan 21, 2023
Fixed the following:
************* Module IV_Swinger
IV_Swinger.py:202:4: R0402: Use 'from RPi import GPIO' instead (consider-using-from-import)
IV_Swinger.py:777:15: E1101: Instance of 'StoppableThread' has no 'isAlive' member (no-member)
IV_Swinger.py:783:11: E1101: Instance of 'StoppableThread' has no 'isAlive' member (no-member)
IV_Swinger.py:4137:16: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger.py:4233:16: R1731: Consider using 'time_left = max(time_left, 0)' instead of unnecessary if block (consider-using-max-builtin)
IV_Swinger.py:4524:23: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger.py:4569:20: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
csatt added a commit that referenced this issue Jan 21, 2023
Fixed the following:

************* Module IV_Swinger2
IV_Swinger2.py:502:8: R1731: Consider using 'dist = max(dist, 2)' instead of unnecessary if block (consider-using-max-builtin)
IV_Swinger2.py:689:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger2.py:697:29: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger2.py:699:29: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger2.py:4491:8: R1731: Consider using 'deflect_begin = max(deflect_begin, 2)' instead of unnecessary if block (consider-using-max-builtin)
IV_Swinger2.py:4571:8: R1731: Consider using 'dist = max(dist, 2)' instead of unnecessary if block (consider-using-max-builtin)
csatt added a commit that referenced this issue Jan 21, 2023
************* Module IV_Swinger2_gui
IV_Swinger2_gui.py:5017:0: R0022: Useless option value for 'disable', 'no-self-use' was moved to an optional extension, see https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers. (useless-option-value)
IV_Swinger2_gui.py:99:0: R0402: Use 'from tkinter import ttk' instead (consider-using-from-import)
IV_Swinger2_gui.py:281:15: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger2_gui.py:353:12: W0621: Redefining name 'e' from outer scope (line 344) (redefined-outer-name)
IV_Swinger2_gui.py:732:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
IV_Swinger2_gui.py:1868:12: R1714: Consider merging these comparisons with 'in' by using 'event.widget in (self.img_size_combo, self.v_range_entry, self.i_range_entry)'. Use a set instead if elements are hashable. (consider-using-in)
csatt added a commit that referenced this issue Jan 21, 2023
************* Module IV_Swinger2_sim
IV_Swinger2_sim.py:97:0: R0402: Use 'from tkinter import ttk' instead (consider-using-from-import)
IV_Swinger2_sim.py:252:15: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name)
IV_Swinger2_sim.py:272:16: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name)
IV_Swinger2_sim.py:312:16: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name)
IV_Swinger2_sim.py:1008:8: R1730: Consider using 'voc_adc = min(voc_adc, ADC_MAX)' instead of unnecessary if block (consider-using-min-builtin)
IV_Swinger2_sim.py:1049:20: R1730: Consider using 'ch0_adc = min(ch0_adc, ADC_MAX)' instead of unnecessary if block (consider-using-min-builtin)
IV_Swinger2_sim.py:1051:20: R1730: Consider using 'ch1_adc = min(ch1_adc, ADC_MAX)' instead of unnecessary if block (consider-using-min-builtin)
IV_Swinger2_sim.py:1206:12: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name)
IV_Swinger2_sim.py:1277:12: W0621: Redefining name 'ohms' from outer scope (line 175) (redefined-outer-name)
IV_Swinger2_sim.py:1397:4: R0914: Too many local variables (16/15) (too-many-locals)
csatt added a commit that referenced this issue Jan 21, 2023
Fix the following:
************* Module IV_Swinger_plotter
IV_Swinger_plotter.py:374:11: C1803: 'self._data_points == []' can be simplified to 'not self._data_points' as an empty sequence is falsey (use-implicit-booleaness-not-comparison)
csatt added a commit that referenced this issue Jan 21, 2023
Fix the following:
************* Module Tooltip
Tooltip.py:2:0: R0402: Use 'from tkinter import ttk' instead (consider-using-from-import)
Tooltip.py:119:12: R1731: Consider using 'x_delta = max(x_delta, 0)' instead of unnecessary if block (consider-using-max-builtin)
Tooltip.py:122:12: R1731: Consider using 'y_delta = max(y_delta, 0)' instead of unnecessary if block (consider-using-max-builtin)
csatt added a commit that referenced this issue Jan 21, 2023
This is needed for one of the pylint fixes to IV_Swinger2_gui.py
@csatt csatt closed this as completed Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmetic Code cleanup, etc.
Projects
None yet
Development

No branches or pull requests

1 participant