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

ci: [pre-commit.ci] pre-commit autoupdate #1184

Merged
merged 9 commits into from
Sep 4, 2024
Merged

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Aug 19, 2024

updates:

Summary by CodeRabbit

  • New Features

    • Updated pre-commit hooks for enhanced functionality and reliability, including improvements in linting and type checking.
  • Style

    • Standardized the usage of decorators by removing unnecessary parentheses across various test files, enhancing readability without impacting functionality.
  • Documentation

    • Added support for Jupyter Notebook files in the project's static analysis checks, improving code quality assurance.
  • Chores

    • Improved organization and formatting in a Jupyter Notebook for better clarity and consistency.

Copy link
Contributor

coderabbitai bot commented Aug 19, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The updates consist of version changes for pre-commit hooks in the .pre-commit-config.yaml file, modifications to decorator syntax across various test files, and a new entry in the pyproject.toml to include Jupyter Notebook files for linting. Additionally, there are cosmetic changes in a Jupyter Notebook related to neuron types, enhancing code organization and readability without altering functionality.

Changes

File Change Summary
.pre-commit-config.yaml Updated ruff-pre-commit from v0.5.7 to v0.6.2 and mypy from v1.11.1 to v1.11.2.
package/.../tifffile_fixes.py Removed # noqa: ARG001 comment from _dummy_report_func method.
package/tests/conftest.py, package/tests/test_PartSeg/conftest.py, package/tests/test_PartSeg/roi_analysis/test_batch.py, package/tests/test_PartSeg/roi_analysis/test_export_batch.py, package/tests/test_PartSeg/roi_analysis/test_image_view.py, package/tests/test_PartSeg/roi_analysis/test_main_window.py, package/tests/test_PartSeg/test_analysis.py, package/tests/test_PartSeg/test_base_widgets.py, package/tests/test_PartSeg/test_channel_control.py, package/tests/test_PartSeg/test_check_release.py, package/tests/test_PartSeg/test_common_backend.py, package/tests/test_PartSeg/test_common_gui.py, package/tests/test_PartSeg/test_main_windows.py, package/tests/test_PartSeg/test_napari_image_view.py, package/tests/test_PartSeg/test_napari_widgets.py, package/tests/test_PartSeg/test_roi_analysis_batch.py, package/tests/test_PartSeg/test_settings.py, package/tests/test_PartSeg/test_viewer.py, package/tests/test_PartSegCore/test_analysis_batch.py, package/tests/test_PartSegCore/test_io.py, package/tests/test_PartSegCore/test_measurements.py, package/tests/test_PartSegCore/test_napari_plugins.py Changed @pytest.fixture() to @pytest.fixture (multiple instances across files). Changed @pytest.mark...() to @pytest.mark... (multiple instances).
pyproject.toml Added entry to associate Jupyter Notebook files with specific checks.
tutorials/.../Neuron_types_example.ipynb Reorganized imports, adjusted formatting and comments, standardized string quotes, and simplified iterations.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PreCommitConfig
    participant TestFiles
    participant PyProject
    participant Notebook

    User->>PreCommitConfig: Update versions
    User->>TestFiles: Modify decorators
    User->>PyProject: Add Jupyter checks
    User->>Notebook: Restructure code
Loading

🐰 In the garden of code, I hop with glee,
New versions and changes, as bright as can be!
Decorators trimmed, like carrots so neat,
Linting for notebooks, oh, what a treat!
Hopping through tests, with joy I prance,
Celebrating updates, let's all take a chance! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.06%. Comparing base (9246402) to head (db25013).
Report is 31 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1184   +/-   ##
========================================
  Coverage    93.06%   93.06%           
========================================
  Files          209      209           
  Lines        32897    32906    +9     
========================================
+ Hits         30614    30623    +9     
  Misses        2283     2283           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 060f4bb to 815623d Compare August 26, 2024 23:21
@Czaki Czaki modified the milestones: 0.15, 0.15.4 Aug 27, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7a66801 and 70d636d.

Files selected for processing (28)
  • .pre-commit-config.yaml (2 hunks)
  • package/PartSegImage/tifffile_fixes.py (1 hunks)
  • package/tests/conftest.py (16 hunks)
  • package/tests/test_PartSeg/conftest.py (3 hunks)
  • package/tests/test_PartSeg/roi_analysis/test_batch.py (1 hunks)
  • package/tests/test_PartSeg/roi_analysis/test_export_batch.py (2 hunks)
  • package/tests/test_PartSeg/roi_analysis/test_image_view.py (4 hunks)
  • package/tests/test_PartSeg/roi_analysis/test_main_window.py (3 hunks)
  • package/tests/test_PartSeg/roi_mask/test_batch.py (1 hunks)
  • package/tests/test_PartSeg/roi_mask/test_main_window.py (2 hunks)
  • package/tests/test_PartSeg/test_analysis.py (4 hunks)
  • package/tests/test_PartSeg/test_base_widgets.py (2 hunks)
  • package/tests/test_PartSeg/test_channel_control.py (4 hunks)
  • package/tests/test_PartSeg/test_check_release.py (1 hunks)
  • package/tests/test_PartSeg/test_common_backend.py (1 hunks)
  • package/tests/test_PartSeg/test_common_gui.py (8 hunks)
  • package/tests/test_PartSeg/test_main_windows.py (2 hunks)
  • package/tests/test_PartSeg/test_napari_image_view.py (5 hunks)
  • package/tests/test_PartSeg/test_napari_widgets.py (8 hunks)
  • package/tests/test_PartSeg/test_roi_analysis_batch.py (1 hunks)
  • package/tests/test_PartSeg/test_settings.py (1 hunks)
  • package/tests/test_PartSeg/test_viewer.py (3 hunks)
  • package/tests/test_PartSegCore/test_analysis_batch.py (13 hunks)
  • package/tests/test_PartSegCore/test_io.py (1 hunks)
  • package/tests/test_PartSegCore/test_measurements.py (2 hunks)
  • package/tests/test_PartSegCore/test_napari_plugins.py (1 hunks)
  • pyproject.toml (1 hunks)
  • tutorials/tutorial_neuron_types/Neuron_types_example.ipynb (17 hunks)
Files skipped from review due to trivial changes (24)
  • .pre-commit-config.yaml
  • package/tests/conftest.py
  • package/tests/test_PartSeg/conftest.py
  • package/tests/test_PartSeg/roi_analysis/test_batch.py
  • package/tests/test_PartSeg/roi_analysis/test_export_batch.py
  • package/tests/test_PartSeg/roi_analysis/test_image_view.py
  • package/tests/test_PartSeg/roi_analysis/test_main_window.py
  • package/tests/test_PartSeg/roi_mask/test_batch.py
  • package/tests/test_PartSeg/roi_mask/test_main_window.py
  • package/tests/test_PartSeg/test_analysis.py
  • package/tests/test_PartSeg/test_base_widgets.py
  • package/tests/test_PartSeg/test_channel_control.py
  • package/tests/test_PartSeg/test_common_backend.py
  • package/tests/test_PartSeg/test_common_gui.py
  • package/tests/test_PartSeg/test_main_windows.py
  • package/tests/test_PartSeg/test_napari_image_view.py
  • package/tests/test_PartSeg/test_napari_widgets.py
  • package/tests/test_PartSeg/test_roi_analysis_batch.py
  • package/tests/test_PartSeg/test_settings.py
  • package/tests/test_PartSegCore/test_analysis_batch.py
  • package/tests/test_PartSegCore/test_io.py
  • package/tests/test_PartSegCore/test_measurements.py
  • package/tests/test_PartSegCore/test_napari_plugins.py
  • tutorials/tutorial_neuron_types/Neuron_types_example.ipynb
Additional context used
Ruff
package/PartSegImage/tifffile_fixes.py

22-22: Unused function argument: self

(ARG001)

Additional comments not posted (5)
package/tests/test_PartSeg/test_check_release.py (1)

16-16: Verify the decorator usage.

The change in the decorator usage from @pytest.mark.enablethread() to @pytest.mark.enablethread might affect how pytest interprets the decorator. Ensure that the decorator is used correctly without parameters.

Verify the decorator usage in the pytest documentation or by running the tests.

package/tests/test_PartSeg/test_viewer.py (3)

22-23: Verify the decorator usage.

The change in the decorator usage from @pytest.mark.windows_ci_skip() to @pytest.mark.windows_ci_skip might affect how pytest interprets the decorator. Ensure that the decorator is used correctly without parameters.

Verify the decorator usage in the pytest documentation or by running the tests.


41-42: Verify the decorator usage.

The change in the decorator usage from @pytest.mark.windows_ci_skip() to @pytest.mark.windows_ci_skip might affect how pytest interprets the decorator. Ensure that the decorator is used correctly without parameters.

Verify the decorator usage in the pytest documentation or by running the tests.


66-67: Verify the decorator usage.

The change in the decorator usage from @pytest.mark.windows_ci_skip() to @pytest.mark.windows_ci_skip might affect how pytest interprets the decorator. Ensure that the decorator is used correctly without parameters.

Verify the decorator usage in the pytest documentation or by running the tests.

pyproject.toml (1)

346-346: LGTM!

The addition of this entry enhances the project's static analysis capabilities by including Jupyter Notebook files in the scope of checks. This change helps maintain code quality and consistency across different file types within the project.

The code changes are approved.

Comment on lines +22 to 23
def _dummy_report_func(self):
"""dummy function for report_func"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused self parameter.

The self parameter is unused in the _dummy_report_func method. Removing it will clean up the code.

Apply this diff to remove the unused parameter:

-def _dummy_report_func(self):
+def _dummy_report_func():
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def _dummy_report_func(self):
"""dummy function for report_func"""
def _dummy_report_func():
"""dummy function for report_func"""
Tools
Ruff

22-22: Unused function argument: self

(ARG001)

@Czaki
Copy link
Collaborator

Czaki commented Aug 27, 2024

pre-tests are failing because of pydantic/pydantic#10239

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.7 → v0.6.3](astral-sh/ruff-pre-commit@v0.5.7...v0.6.3)
- [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](pre-commit/mirrors-mypy@v1.11.1...v1.11.2)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 70d636d to 486301a Compare September 2, 2024 22:54
Copy link

sonarqubecloud bot commented Sep 4, 2024

@Czaki Czaki merged commit dd2cbd3 into develop Sep 4, 2024
63 checks passed
@Czaki Czaki deleted the pre-commit-ci-update-config branch September 4, 2024 18:54
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