Skip to content

Conversation

@larsevj
Copy link
Collaborator

@larsevj larsevj commented Oct 2, 2025

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.16%. Comparing base (d341b80) to head (2ca3f1f).

Files with missing lines Patch % Lines
...subscript/sw_model_utilities/sw_model_utilities.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #814      +/-   ##
==========================================
+ Coverage   83.11%   83.16%   +0.04%     
==========================================
  Files          48       48              
  Lines        7126     7122       -4     
==========================================
  Hits         5923     5923              
+ Misses       1203     1199       -4     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@larsevj larsevj force-pushed the add_ruff_rules_PL branch from dada363 to 8a5b984 Compare October 2, 2025 12:18
@larsevj larsevj changed the title Add ruff rules PL Add ruff rules PL, B Oct 2, 2025
@larsevj larsevj force-pushed the add_ruff_rules_PL branch from 8a5b984 to 9116a65 Compare October 2, 2025 12:26
@larsevj larsevj requested a review from Copilot October 2, 2025 12:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new ruff rules PL (pylint) and B (flake8-bugbear) to the linting configuration and fixes violations identified by these rules throughout the codebase.

  • Adds pylint (PL) and flake8-bugbear (B) rules to ruff configuration with appropriate exceptions
  • Fixes code style violations related to subprocess calls, loop variables, nested conditionals, and zip operations
  • Improves code maintainability by removing unused imports and simplifying conditional structures

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Adds PL and B ruff rules with configuration and ignored rule exceptions
tests/utils.py Replaces pylint disable comment with explicit check=False parameter
tests/test_merge_rft_ertobs.py Removes duplicate "report_step" from set definition
tests/test_field_statistics.py Moves subprocess import to top-level, removes unused variables and comments, simplifies conditionals
tests/test_check_swatinit_simulators.py Simplifies nested if-else structure to elif
tests/test_check_swatinit.py Simplifies nested if-else structure to elif
tests/test_casegen_upcars.py Adds strict=False to zip() calls for length safety
src/subscript/sw_model_utilities/sw_model_utilities.py Fixes variable reference and adds strict=False to zip()
src/subscript/summaryplot/summaryplot.py Simplifies nested if-else structure to elif
src/subscript/sector2fluxnum/flux_util.py Replaces multiple or conditions with membership test
src/subscript/ri_wellmod/ri_wellmod.py Adds strict=False to zip() call
src/subscript/restartthinner/restartthinner.py Fixes variable reference in loop
src/subscript/prtvol2csv/prtvol2csv.py Adds stacklevel parameter to warnings
src/subscript/pack_sim/pack_sim.py Iterates over dict items instead of keys, simplifies conditional
src/subscript/ofmvol2csv/ofmvol2csv.py Adds strict=False to zip() call
src/subscript/hook_implementations/forward_model_steps.py Removes trailing comment marker
src/subscript/grav_subs_points/grav_subs_points.py Prefixes unused loop variables with underscore, adds strict=False to zip()
src/subscript/grav_subs_maps/grav_subs_maps.py Prefixes unused loop variables with underscore
src/subscript/fmuobs/parsers.py Adds strict=False to zip() call
src/subscript/fmu_copy_revision/fmu_copy_revision.py Adds noqa comment for intentional loop variable reuse
src/subscript/field_statistics/field_statistics.py Moves imports to top-level
src/subscript/eclcompress/eclcompress.py Simplifies conditional structure
src/subscript/csv_stack/csv_stack.py Adds stacklevel parameter to warning
src/subscript/check_swatinit/check_swatinit.py Adds strict=False to zip() call
src/subscript/casegen_upcars/model.py Simplifies conditionals, adds strict=False to zip() calls, removes unused variables
src/subscript/casegen_upcars/casegen_upcars.py Adds strict=False to zip() calls

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@larsevj
Copy link
Collaborator Author

larsevj commented Oct 2, 2025

Test for field_statistics failed with too many values to unpack:

ValueError: too many values to unpack (expected 13)
======================================================================================= short test summary info =======================================================================================
FAILED tests/test_field_statistics.py::test_main[config_file0-config_dict0] - subprocess.CalledProcessError: Command '['field_statistics', '-c', '/tmp/pytest-of-levje/pytest-315/test_main_config_file0_config_0/testdata_field_statistics/config_example.yml', '-p', '/tmp/pyt...

meaning that this module cannot have been working as expected before..
(Was fixed in another pr..)

@larsevj larsevj requested a review from Copilot October 2, 2025 13:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@larsevj larsevj force-pushed the add_ruff_rules_PL branch 2 times, most recently from cfc849f to 08c9906 Compare October 21, 2025 08:31
@larsevj larsevj requested a review from Copilot October 21, 2025 12:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@larsevj larsevj requested review from a team and alifbe October 21, 2025 12:47
@larsevj larsevj requested a review from rnyb October 24, 2025 10:39
@larsevj larsevj merged commit 6f9ec90 into main Oct 24, 2025
5 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.

4 participants