diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c48fea61050..354b3f8a08d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: exclude: test-data/ert/eclipse/parse/ERROR.PRT # exact format is needed for testing - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.3 + rev: v0.8.0 hooks: - id: ruff args: [ --fix ] diff --git a/src/_ert/forward_model_runner/forward_model_step.py b/src/_ert/forward_model_runner/forward_model_step.py index 6acd3428110..bc4b649e0e8 100644 --- a/src/_ert/forward_model_runner/forward_model_step.py +++ b/src/_ert/forward_model_runner/forward_model_step.py @@ -354,7 +354,7 @@ def _check_job_files(self) -> list[str]: def _check_target_file_is_written( self, target_file_mtime: int, timeout: int = 5 - ) -> None | str: + ) -> str | None: """ Check whether or not a target_file eventually appear. Returns None in case of success, an error message in the case of failure. diff --git a/src/ert/config/parsing/config_schema_item.py b/src/ert/config/parsing/config_schema_item.py index ae289679b80..a7947800744 100644 --- a/src/ert/config/parsing/config_schema_item.py +++ b/src/ert/config/parsing/config_schema_item.py @@ -198,7 +198,7 @@ def apply_constraints( keyword: FileContextToken, cwd: str, ) -> Union[ - T, MaybeWithContext, None, ContextList[Union[T, MaybeWithContext, None]] + T, MaybeWithContext, ContextList[Union[T, MaybeWithContext, None]], None ]: errors: List[Union[ErrorInfo, ConfigValidationError]] = [] diff --git a/src/ert/scheduler/lsf_driver.py b/src/ert/scheduler/lsf_driver.py index 2f45b2bde5c..df761d128a0 100644 --- a/src/ert/scheduler/lsf_driver.py +++ b/src/ert/scheduler/lsf_driver.py @@ -371,7 +371,9 @@ async def submit( self._job_error_message_by_iens[iens] = process_message raise FailedSubmit(process_message) - match = re.search("Job <([0-9]+)> is submitted to .*queue", process_message) + match = re.search( + r"Job <([0-9]+)> is submitted to .*queue", process_message + ) if match is None: raise FailedSubmit( f"Could not understand '{process_message}' from bsub" diff --git a/src/ert/substitutions.py b/src/ert/substitutions.py index bda5dc09983..5bcc3090391 100644 --- a/src/ert/substitutions.py +++ b/src/ert/substitutions.py @@ -9,7 +9,7 @@ from pydantic_core import core_schema logger = logging.getLogger(__name__) -_PATTERN = re.compile("<[^<>]+>") +_PATTERN = re.compile(r"<[^<>]+>") from collections import UserDict diff --git a/src/ert/validation/integer_argument.py b/src/ert/validation/integer_argument.py index 9ed9d18f5f7..719a6b033fb 100644 --- a/src/ert/validation/integer_argument.py +++ b/src/ert/validation/integer_argument.py @@ -9,7 +9,7 @@ class IntegerArgument(ArgumentDefinition): NOT_INTEGER = "The argument must be an integer." NOT_IN_RANGE = "The argument is not in range: %s" - pattern = re.compile("^-?[0-9]+$") + pattern = re.compile(r"^-?[0-9]+$") def __init__( self, diff --git a/tests/everest/test_data/mocked_test_case/jobs/well_order_mock.py b/tests/everest/test_data/mocked_test_case/jobs/well_order_mock.py index 259fd7d8faf..a8f5b86f5da 100755 --- a/tests/everest/test_data/mocked_test_case/jobs/well_order_mock.py +++ b/tests/everest/test_data/mocked_test_case/jobs/well_order_mock.py @@ -11,7 +11,7 @@ def create_file(order, template_file, target_file): open(template_file, encoding="utf-8") as readH, ): for line in readH.readlines(): - match_obj = re.search("(__[A-Z]+_[0-9]__)", line) + match_obj = re.search(r"(__[A-Z]+_[0-9]__)", line) if match_obj: new_well = order.popitem(False)[0] line = line.replace(match_obj.group(1), new_well)