-
Notifications
You must be signed in to change notification settings - Fork 39
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
chore: minor cleanup in app, main and package init #524
base: master
Are you sure you want to change the base?
Conversation
@@ -2,15 +2,13 @@ | |||
# | |||
# SPDX-License-Identifier: MIT | |||
|
|||
# coding: utf-8 | |||
# ruff: noqa: F401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We change from ignoring all violations to the one we need here: "F401", unused import.
This enables us e.g. to sort the imports.
fuji_server/app.py
Outdated
myjsonifier = Jsonifier(json, cls=encoder.CustomJSONEncoder) | ||
# app = connexion.FlaskApp(__name__, specification_dir=YAML_DIR, jsonifier=encoder.CustomJsonifier) | ||
app = connexion.App(__name__, specification_dir=YAML_DIR, jsonifier=myjsonifier) | ||
jsonifier = Jsonifier(json, cls=encoder.CustomJSONEncoder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed myjsonifier
and removed unused code for readability.
@@ -7,54 +7,43 @@ | |||
import argparse | |||
import configparser | |||
import logging | |||
import os | |||
import logging.config | |||
from pathlib import Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We move from using os.path
to the modern pathlib.Path
.
# YAML_DIR = os.path.join(my_path, config['SERVICE']['yaml_directory']) | ||
METRIC_YML_PATH = os.path.join(ROOT_DIR, YAML_DIR) | ||
print("YAML PATH", METRIC_YML_PATH) | ||
"""SPDX_URL = config['EXTERNAL']['spdx_license_github'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused lines for readability.
logger.info(f"Total subjects area of imported metadata standards : {len(preproc.metadata_standards)}") | ||
logger.info(f"Total LD vocabs imported : {len(preproc.getLinkedVocabs())}") | ||
logger.info(f"Total default namespaces specified : {len(preproc.getDefaultNamespaces())}") | ||
logger.info("Total SPDX licenses: %s", preproc.get_total_licenses()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per flake8-logging-format we use %s instead of f-string in logging messages.
logging_config = configparser.ConfigParser() | ||
logging_config.read(log_configfile) | ||
|
||
logging.config.fileConfig(log_configfile, defaults={"logfilename": log_file_path}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now use the logging config file (again).
Resolved merge conflicts. |
Description
This PR offers a couple of minor cleanups, see comments in the changed files.
Types of changes
Checklist