-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update precommit rules and doc compilation #217
Conversation
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.
✅ Code Health Quality Gates: OK
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 2 findings(s) 🚩
@@ -70,7 +70,7 @@ def log_debug(logger: logger, msg: str, verbose: bool = False) -> None: | |||
|
|||
Parameters | |||
---------- | |||
logger : logger | |||
logger : logging.Logger |
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.
❌ New issue: Code Duplication
The module contains 4 functions with similar structure: log_debug,log_error,log_info,log_warning
for more information, see https://pre-commit.ci
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.
✅ Code Health Quality Gates: OK
- Declining Code Health: 2 findings(s) 🚩
def linkcode_resolve(domain, info): | ||
""" | ||
Determine the URL corresponding to Python object | ||
""" | ||
if domain != "py": | ||
return None | ||
|
||
modname = info["module"] | ||
fullname = info["fullname"] | ||
|
||
submod = sys.modules.get(modname) | ||
if submod is None: | ||
return None | ||
|
||
obj = submod | ||
for part in fullname.split("."): | ||
try: | ||
obj = getattr(obj, part) | ||
except AttributeError: | ||
return None | ||
|
||
try: | ||
fn = inspect.getsourcefile(inspect.unwrap(obj)) | ||
except TypeError: | ||
try: # property | ||
fn = inspect.getsourcefile(inspect.unwrap(obj.fget)) | ||
except (AttributeError, TypeError): | ||
fn = None | ||
if not fn: | ||
return None | ||
|
||
try: | ||
source, lineno = inspect.getsourcelines(obj) | ||
except TypeError: | ||
try: # property | ||
source, lineno = inspect.getsourcelines(obj.fget) | ||
except (AttributeError, TypeError): | ||
lineno = None | ||
except OSError: | ||
lineno = None | ||
|
||
if lineno: | ||
linespec = f"#L{lineno}-L{lineno + len(source) - 1}" | ||
else: | ||
linespec = "" | ||
|
||
fn = os.path.relpath(fn, start=os.path.dirname(disdrodb.__file__)) | ||
|
||
if "+" in disdrodb.__version__: | ||
return f"https://github.com/ltelab/disdrodb/blob/main/disdrodb/{fn}{linespec}" | ||
else: | ||
return f"https://github.com/ltelab/disdrodb/blob/" f"v{disdrodb.__version__}/disdrodb/{fn}{linespec}" |
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.
❌ New issue: Complex Method
linkcode_resolve has a cyclomatic complexity of 15, threshold = 9
Prework
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and communicate accordingly:
The PR fulfills these requirements:
reader-<institute>-<campaign>
bugfix-<some_key>-<word>
doc-<some_key>-<word>
feature-<some_key>-<word>
refactor-<some_key>-<word>
optimize-<some_key>-<word>
fix #xxx[,#xxx]
, where "xxx" is the issue number)Summary
Update precommits rules and documentation compilation.