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

feat: Use pygments for coloring code in exception window #591

Merged
merged 4 commits into from
Apr 25, 2022

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Apr 24, 2022

No description provided.

@Czaki Czaki added this to the 0.14.1 milestone Apr 24, 2022
@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/591

@codecov
Copy link

codecov bot commented Apr 24, 2022

Codecov Report

Merging #591 (9aec826) into develop (dc52158) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #591      +/-   ##
===========================================
+ Coverage    80.54%   80.57%   +0.03%     
===========================================
  Files          143      143              
  Lines        19150    19130      -20     
===========================================
- Hits         15424    15414      -10     
+ Misses        3726     3716      -10     
Impacted Files Coverage Δ
package/PartSegCore/algorithm_describe_base.py 86.29% <ø> (-1.60%) ⬇️
.../PartSeg/common_backend/python_syntax_highlight.py 100.00% <100.00%> (+22.05%) ⬆️
package/PartSeg/common_gui/error_report.py 73.03% <100.00%> (+0.77%) ⬆️
package/PartSegCore/segmentation/algorithm_base.py 92.25% <100.00%> (+0.28%) ⬆️

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 dc52158...9aec826. Read the comment docs.

@Czaki Czaki force-pushed the feature/better_syntax_higlight branch from 14351a5 to 81fd088 Compare April 24, 2022 14:09
@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/591

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/591

@lgtm-com
Copy link

lgtm-com bot commented Apr 25, 2022

This pull request introduces 1 alert when merging 0a934a5 into dc52158 - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Apr 25, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 1.66%.

Quality metrics Before After Change
Complexity 6.34 ⭐ 5.92 ⭐ -0.42 👍
Method Length 53.24 ⭐ 50.99 ⭐ -2.25 👍
Working memory 8.59 🙂 8.24 🙂 -0.35 👍
Quality 67.08% 🙂 68.74% 🙂 1.66% 👍
Other metrics Before After Change
Lines 1095 1035 -60
Changed files Quality Before Quality After Quality Change
package/PartSeg/common_backend/python_syntax_highlight.py 58.78% 🙂 83.00% ⭐ 24.22% 👍
package/PartSeg/common_gui/error_report.py 53.34% 🙂 53.05% 🙂 -0.29% 👎
package/PartSegCore/algorithm_describe_base.py 69.40% 🙂 69.16% 🙂 -0.24% 👎
package/PartSegCore/segmentation/algorithm_base.py 82.30% ⭐ 82.36% ⭐ 0.06% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
package/PartSegCore/algorithm_describe_base.py ROIExtractionProfile._pretty_print 21 😞 201 😞 12 😞 36.10% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/common_gui/error_report.py ErrorDialog.__init__ 6 ⭐ 333 ⛔ 13 😞 41.13% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/common_gui/error_report.py ErrorDialog.send_information 11 🙂 209 ⛔ 11 😞 45.24% 😞 Try splitting into smaller methods. Extract out complex expressions
package/PartSeg/common_gui/error_report.py DataImportErrorDialog.__init__ 15 🙂 262 ⛔ 7 🙂 47.25% 😞 Try splitting into smaller methods
package/PartSegCore/algorithm_describe_base.py AlgorithmProperty.__init__ 8 ⭐ 138 😞 16 ⛔ 47.39% 😞 Try splitting into smaller methods. 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!

@deprecated-napari-hub-preview-bot

Preview page for your plugin is ready here:
https://preview.napari-hub.org/4DNucleome/PartSeg/591

@Czaki Czaki merged commit d519d3a into develop Apr 25, 2022
@Czaki Czaki deleted the feature/better_syntax_higlight branch April 25, 2022 10:41
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.

1 participant