Style pass for newly integrated modules
This commit is contained in:
parent
633e5d7ece
commit
e097917633
|
@ -16,7 +16,7 @@ LOGGING_CONFIG = {
|
|||
},
|
||||
"fmt_detailed": {
|
||||
"validate": True,
|
||||
"format": "%(asctime)s %(levelname)s %(message)s"
|
||||
"format": "%(asctime)s %(levelname)s %(message)s",
|
||||
},
|
||||
},
|
||||
"handlers": {
|
||||
|
@ -29,8 +29,8 @@ LOGGING_CONFIG = {
|
|||
"loggers": {
|
||||
__name__: {
|
||||
"level": "DEBUG",
|
||||
"handlers": ["hnd_stderr"]
|
||||
}
|
||||
"handlers": ["hnd_stderr"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ def add_subcommand(subparsers, module) -> None:
|
|||
|
||||
def init_logger(args):
|
||||
"""Set up logging based on verbosity args"""
|
||||
if (args.verbose):
|
||||
if args.verbose:
|
||||
handler = LOGGING_CONFIG["handlers"]["hnd_stderr"]
|
||||
handler["formatter"] = "fmt_detailed"
|
||||
handler["level"] = "DEBUG"
|
||||
|
|
|
@ -14,7 +14,9 @@ COMMAND_HELP = "Interact with Amanuensis."
|
|||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@add_argument("path", metavar="DB_PATH", help="Path to where the database should be created")
|
||||
@add_argument(
|
||||
"path", metavar="DB_PATH", help="Path to where the database should be created"
|
||||
)
|
||||
@add_argument("--force", "-f", action="store_true", help="Overwrite existing database")
|
||||
@add_argument("--verbose", "-v", action="store_true", help="Enable db echo")
|
||||
def command_init_db(args) -> int:
|
||||
|
|
|
@ -29,6 +29,7 @@ class EnvironmentConfig(AmanuensisConfig):
|
|||
|
||||
class CommandLineConfig(AmanuensisConfig):
|
||||
"""Loads config values from command line arguments."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("--config-file", default=AmanuensisConfig.CONFIG_FILE)
|
||||
|
|
2
mypy.ini
2
mypy.ini
|
@ -1,4 +1,4 @@
|
|||
[mypy]
|
||||
ignore_missing_imports = true
|
||||
exclude = "amanuensis/cli/.*|amanuensis/config/.*|amanuensis/lexicon/.*|amanuensis/log/.*|amanuensis/models/.*|amanuensis/resources/.*|amanuensis/server/.*|amanuensis/user/.*|amanuensis/__main__.py"
|
||||
exclude = "|amanuensis/lexicon/.*|amanuensis/models/.*|amanuensis/resources/.*|amanuensis/server/.*|amanuensis/user/.*|amanuensis/__main__.py|"
|
||||
; mypy stable doesn't support pyproject.toml yet
|
|
@ -21,7 +21,7 @@ amanuensis-cli = "amanuensis.cli:main"
|
|||
amanuensis-server = "amanuensis.server:run"
|
||||
|
||||
[tool.black]
|
||||
extend-exclude = "^/amanuensis/cli/.*|^/amanuensis/config/.*|^/amanuensis/lexicon/.*|^/amanuensis/log/.*|^/amanuensis/models/.*|^/amanuensis/resources/.*|^/amanuensis/server/.*|^/amanuensis/user/.*|^/amanuensis/__main__.py"
|
||||
extend-exclude = "^/amanuensis/lexicon/.*|^/amanuensis/models/.*|^/amanuensis/resources/.*|^/amanuensis/server/.*|^/amanuensis/user/.*|^/amanuensis/__main__.py"
|
||||
|
||||
[tool.mypy]
|
||||
ignore_missing_imports = true
|
||||
|
|
Loading…
Reference in New Issue