flake8
-
rbtools/utils/filesystem.py (Diff revision 1) Show all issues
Review Request #13028 — Created May 10, 2023 and submitted
This introduces a new
rbtools.config
module that's responsible for all
configuration management for RBTools. It handles scanning for
.reviewboardrc
files, loading them, and providing an object that can
be used for looking up settings.Half of this is code moved out from
rbtools.utils.filesystem
and
updated (for typing, cleanup, and moving out config merging support to
the other half).The other half is the new wrapper for configuration state.
rbtools.config.config.RBToolsConfig
(which is not at all a
redundant-sunding namespace) is an object that wraps a loaded
dictionary. This provides a few advantages over the old dictionary:
Option
.get(..., default)
calls.Custom settings not known to the RBTools codebase are still loaded and
can be accessed.
This will make it easier to create and maintain settings going forward.
Some initial plans for this change were scrapped, such as type
validation on load and config-driven option construction. For the latter
case, the thought was to make parameters, help output, and defaults all
come from the central config, but upon reflection, it was ultimately
decided that that would box us in if we ever wanted to make larger
changes to options. These will remain independent, but a future change
will update options to get their defaults from the central
configuration.
As of now, code is still using the now-deprecated functions for loading
configuration. That will be updated in a separate change.
Unit tests pass.
Used this to post this change, verifying it relied on my aliases and
my Markdown setting in my home directory and the repository settings
in the repository.
Summary | ID |
---|---|
23575892e143d4ae3e8df3573c51fda93d945b1f |
Description | From | Last Updated |
---|---|---|
'typing_extensions.TypeAlias' imported but unused Column: 1 Error code: F401 |
![]() |
|
local variable 'config_file1' is assigned to but never used Column: 9 Error code: F841 |
![]() |
|
local variable 'config_file2' is assigned to but never used Column: 9 Error code: F841 |
![]() |
|
local variable 'config_file3' is assigned to but never used Column: 9 Error code: F841 |
![]() |
|
local variable 'config_file4' is assigned to but never used Column: 9 Error code: F841 |
![]() |
|
local variable 'config_file5' is assigned to but never used Column: 9 Error code: F841 |
![]() |
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+3414 -162) |
rbtools/config/tests/test_loader.py (Diff revision 2) |
---|
local variable 'config_file1' is assigned to but never used Column: 9 Error code: F841
rbtools/config/tests/test_loader.py (Diff revision 2) |
---|
local variable 'config_file2' is assigned to but never used Column: 9 Error code: F841
rbtools/config/tests/test_loader.py (Diff revision 2) |
---|
local variable 'config_file3' is assigned to but never used Column: 9 Error code: F841
rbtools/config/tests/test_loader.py (Diff revision 2) |
---|
local variable 'config_file4' is assigned to but never used Column: 9 Error code: F841
rbtools/config/tests/test_loader.py (Diff revision 2) |
---|
local variable 'config_file5' is assigned to but never used Column: 9 Error code: F841
Removed unused variables.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+3414 -162) |