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

🔧Add more QA tools for parts of glotaran #739

Merged
merged 2 commits into from
Jul 4, 2021

Conversation

s-weigand
Copy link
Member

@s-weigand s-weigand commented Jul 4, 2021

Adds the QA tools pydocstyle, darglint and mypy for the glotaran subpackages plugin_system, utils and deprecation.
This way we can activate them step by step for each module when it is up to standard.

Change summary

  • Adds pre-commit-hook mypy for ^glotaran/(plugin_system|utils|deprecation)
  • Adds pre-commit-hook pydocstyle for ^glotaran/(plugin_system|utils|deprecation)
  • Adds pre-commit-hook darglint for ^glotaran/(plugin_system|utils|deprecation)

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)

@s-weigand s-weigand requested review from joernweissenborn, jsnel and a team as code owners July 4, 2021 17:01
@s-weigand s-weigand added the Type: Tooling Tools used for the project (CI, CD, docs etc.) label Jul 4, 2021
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 4, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.03%.

Quality metrics Before After Change
Complexity 1.27 ⭐ 1.24 ⭐ -0.03 👍
Method Length 34.92 ⭐ 35.05 ⭐ 0.13 👎
Working memory 5.97 ⭐ 5.97 ⭐ 0.00
Quality 84.89% 84.86% -0.03% 👎
Other metrics Before After Change
Lines 1572 1575 3
Changed files Quality Before Quality After Quality Change
glotaran/deprecation/deprecation_utils.py 76.17% ⭐ 76.05% ⭐ -0.12% 👎
glotaran/plugin_system/data_io_registration.py 92.67% ⭐ 92.67% ⭐ 0.00%
glotaran/plugin_system/model_registration.py 86.14% ⭐ 86.14% ⭐ 0.00%
glotaran/plugin_system/project_io_registration.py 88.97% ⭐ 88.97% ⭐ 0.00%
glotaran/utils/ipython.py 91.99% ⭐ 91.99% ⭐ 0.00%
glotaran/utils/test/test_ipython.py 85.63% ⭐ 85.87% ⭐ 0.24% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
glotaran/deprecation/deprecation_utils.py check_qualnames_in_tests.warn_deprecated 2 ⭐ 102 🙂 14 😞 60.12% 🙂 Extract out complex expressions
glotaran/deprecation/deprecation_utils.py check_qualnames_in_tests 6 ⭐ 87 🙂 10 😞 64.90% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Copy link
Member

@joernweissenborn joernweissenborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@sonarcloud
Copy link

sonarcloud bot commented Jul 4, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2021

Binder 👈 Launch a binder notebook on branch s-weigand/pyglotaran/partial-qa-tools

@codecov
Copy link

codecov bot commented Jul 4, 2021

Codecov Report

Merging #739 (52afbfc) into staging (9aee6b9) will not change coverage.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           staging    #739   +/-   ##
=======================================
  Coverage     79.3%   79.3%           
=======================================
  Files           83      83           
  Lines         4127    4127           
  Branches       720     720           
=======================================
  Hits          3274    3274           
  Misses         728     728           
  Partials       125     125           
Impacted Files Coverage Δ
glotaran/plugin_system/data_io_registration.py 100.0% <ø> (ø)
glotaran/plugin_system/model_registration.py 100.0% <ø> (ø)
glotaran/plugin_system/project_io_registration.py 100.0% <ø> (ø)
glotaran/utils/ipython.py 90.0% <ø> (ø)
glotaran/deprecation/deprecation_utils.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9aee6b9...52afbfc. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2021

Benchmark is done. Checkout the benchmark result page.
Benchmark differences below 5% might be due to CI noise.

Benchmark diff

All benchmarks:

       before           after         ratio
     [dc00e6da]       [52afbfc0]
     <v0.4.0>                   
             179M             181M     1.01  IntegrationTwoDatasets.peakmem_create_result
             197M             203M     1.03  IntegrationTwoDatasets.peakmem_optimize
+         265±2ms          897±6ms     3.39  IntegrationTwoDatasets.time_create_result
+      5.71±0.01s          1.04±0m    10.95  IntegrationTwoDatasets.time_optimize

Copy link
Member

@jsnel jsnel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@s-weigand s-weigand merged commit a9aa511 into glotaran:staging Jul 4, 2021
@s-weigand s-weigand deleted the partial-qa-tools branch July 4, 2021 17:43
s-weigand added a commit that referenced this pull request Jul 9, 2021
* 🔧 Allowed mypy to run on a subset of glotaran

modules that will be checked are:
- utils
- plugin_system
- deprecation

* 🔧 Partially activated docstring QA tools and fixed issues

modules that will be checked are:
- utils
- plugin_system
- deprecation
jsnel pushed a commit that referenced this pull request Aug 14, 2021
* 🔧 Allowed mypy to run on a subset of glotaran

modules that will be checked are:
- utils
- plugin_system
- deprecation

* 🔧 Partially activated docstring QA tools and fixed issues

modules that will be checked are:
- utils
- plugin_system
- deprecation
jsnel pushed a commit to jsnel/pyglotaran that referenced this pull request Aug 14, 2021
* 🔧 Allowed mypy to run on a subset of glotaran

modules that will be checked are:
- utils
- plugin_system
- deprecation

* 🔧 Partially activated docstring QA tools and fixed issues

modules that will be checked are:
- utils
- plugin_system
- deprecation
jsnel pushed a commit that referenced this pull request Sep 16, 2021
* 🔧 Allowed mypy to run on a subset of glotaran

modules that will be checked are:
- utils
- plugin_system
- deprecation

* 🔧 Partially activated docstring QA tools and fixed issues

modules that will be checked are:
- utils
- plugin_system
- deprecation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Tooling Tools used for the project (CI, CD, docs etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants