Skip to content

Commit

Permalink
Upgrade pre-commit ruff 0.7.3 -> 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Nov 25, 2024
1 parent fe9926b commit e33dfe7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down
2 changes: 1 addition & 1 deletion src/_ert/forward_model_runner/forward_model_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/ert/config/parsing/config_schema_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = []

Expand Down
4 changes: 3 additions & 1 deletion src/ert/scheduler/lsf_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/ert/substitutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ert/validation/integer_argument.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e33dfe7

Please sign in to comment.