-
Notifications
You must be signed in to change notification settings - Fork 189
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
Reduce pylint/flake8/Pyright/black/bandit errors #2120
base: master
Are you sure you want to change the base?
Conversation
Reduce pylint/flake8/Pyright/black/bandit errors to a minimum. As so many errors are shown in IDEs, it becomes distracting and we risk ignoring serious bugs within the noise. Among other things, this reorganizes imports, removing unused ones, breaks most long lines, and standardizes quotes as preferred by `black`. Remove `seed` variable in `run_offline_command` because it's never accessed. Add booleans `is_storage_pw_req` and `is_wallet_pw_req` for better readability.
I understand your motivation for submitting this PR -- and all of your help is very much appreciated. I do agree that minimal lint warnings in IDEs does make it easier to detect actual problems in the code. For new code we write I do recommend we stick to the latest linting craze that Python people have decided is what they prefer. No resistance there on that. But -- this type of commit where we update an ancient file that nobody really changes much -- is not a great idea in my opinion. Commits such as these risk introducing new bugs and incompatibilities. Given that the rest of this app is by no means compliant with the latest pylint fashion anyway -- it's not like that much is gained by linting this file in this way. On top of that, just personal taste-wise -- I personally am not a huge fan of some aspects of the latest strict python linting fashion (and it really is a fashion). Things like insisting on That being said --- this particular file -- I do agree its code was nasty in the past and is still nasty. I didn't write it -- it's not my code. It's hugely complex for what it is. I would prefer we just not open up more cans of worms for ourselves. We risk introducing new bugs here.. and the practical benefit the way I see it is not very large, considering that this file is rarely updated anyway. |
Lazily import `websockets` and add a comment explaining it's because `SimpleWebSocketServer` isn't always available.
I personally don't love some choices My main motivation is that clean code attracts new developers, in quantity and quality. And having more developers coming to BCH is a good thing.
I didn't know where to start, and the executable file seemed like the obvious choice. I'm trying to do "Right Work" , as opposed to Good Work or even Great Work. Please see the linked post to understand what I mean.
I'm not planning more cleanup on this file. If you think it's too risky to merge this I'll understand. |
Reduce pylint/flake8/Pyright/black/bandit errors to a minimum.
As so many errors are shown in IDEs, it becomes distracting and we risk ignoring serious bugs within the noise.
Among other things, this reorganizes imports, removing unused ones, breaks most long lines, and standardizes quotes as preferred by
black
.Remove
seed
variable inrun_offline_command
because it's never accessed.Add booleans
is_storage_pw_req
andis_wallet_pw_req
for better readability.This change is