Code Quality: Improve dashboard code and fix warnings#155
Open
mkh-user wants to merge 1 commit into
Open
Conversation
Code quality improve for dashboard: - Add '_' prefix to unused arguments - Rename shadowed names (internals) - Mark unused 'app.run(debug)' as TODO (follow-up) - Improve grammar in docs - Convert simple functions to static methods - Cleanup sorting logic and clarify its real behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
No behavior change or fix (tested), just fixes warnings like unused argument and shadowed name, and a small grammar fix. An unnecessary convert
v if v is not None else ""was changed tov, and the misleading comment associated with it was corrected. Additionally, the unuseddebugparameter indashboard/app.run()was marked for separate correction.Details
Performed improvements:
Follow-Ups
fenn/dashboard/app.py:335-347:+# TODO: Use 'debug' in logger def run( host: str = "127.0.0.1", port: int = 5000, debug: bool = False, log_dirs=None ) -> None: """Configure and start the dashboard server.""" if log_dirs: scanner.add_dirs(log_dirs) logging.getLogger("werkzeug").setLevel(logging.ERROR) app.logger.setLevel(logging.ERROR) print(f"Fenn dashboard started at http://{host}:{port}") from werkzeug.serving import make_server make_server(host, port, app).serve_forever()debugparameter is not used here, marked to catch later, proposed usage is:Is this change appropriate to create another PR for it?