Skip to content
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

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

ghiggi
Copy link
Collaborator

@ghiggi ghiggi commented Jun 5, 2024

Prework

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and communicate accordingly:

The PR fulfills these requirements:

  • It's submitted to the branch named as follow :
    • Add a reader: reader-<institute>-<campaign>
    • Fix a bug: bugfix-<some_key>-<word>
    • Improve the doc: doc-<some_key>-<word>
    • Add a new feature: feature-<some_key>-<word>
    • Refactor some code: refactor-<some_key>-<word>
    • Optimize some code: optimize-<some_key>-<word>
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • Don't forget to link PR to issue if you are solving one.
  • All tests are passing.
  • New/updated tests are included

Summary

Update precommits rules and documentation compilation.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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

View detailed results in CodeScene

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 96.4%. remained the same
when pulling 5101bbf on ghiggi:update-precommits
into 4e4df3f on ltelab:main.

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 96.4%. remained the same
when pulling 5101bbf on ghiggi:update-precommits
into 4e4df3f on ltelab:main.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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) 🚩

View detailed results in CodeScene

@@ -70,7 +70,7 @@ def log_debug(logger: logger, msg: str, verbose: bool = False) -> None:

Parameters
----------
logger : logger
logger : logging.Logger

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

Suppress

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a 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) 🚩

View detailed results in CodeScene

Comment on lines +162 to +213
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}"

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

Suppress

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 96.4%. remained the same
when pulling 1929dd8 on ghiggi:update-precommits
into 4e4df3f on ltelab:main.

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 96.4%. remained the same
when pulling 1929dd8 on ghiggi:update-precommits
into 4e4df3f on ltelab:main.

@ghiggi ghiggi merged commit 99ad0c4 into ltelab:main Jun 5, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants