Skip to content

Commit

Permalink
STYLE: update black & reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Feb 13, 2024
1 parent e3bfdbb commit 3652eb8
Show file tree
Hide file tree
Showing 10 changed files with 169 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
python-version: '3.8'
- run: |
pip install black
pip install black==24.2.0
.run/lint_black.sh
Pycodestyle:
Expand Down
2 changes: 1 addition & 1 deletion .run/lint_pycodestyle.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

pycodestyle $(pwd) --ignore=E501,W503,E402,E731,E203 --exclude=.venv
pycodestyle $(pwd) --ignore=E501,W503,E402,E731,E203,E704 --exclude=.venv
65 changes: 31 additions & 34 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ future = "*"
typing-extensions = ">=4.9.0"

[tool.poetry.dev-dependencies]
black = "^23.3.0"
black = "^24.2.0"
pycodestyle = "*"
pylint = "^2.7.2"
pytest = "*"
Expand Down
16 changes: 6 additions & 10 deletions selene/common/predicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ def equals_ignoring_case(expected):


def equals(expected, ignore_case=False):
return (
lambda actual: expected == actual
if not ignore_case
else equals_ignoring_case(expected)
return lambda actual: (
expected == actual if not ignore_case else equals_ignoring_case(expected)
)


Expand Down Expand Up @@ -78,19 +76,17 @@ def includes_word_ignoring_case(expected):


def includes_word(expected, ignore_case=False):
return (
lambda actual: expected in re.split(r'\s+', actual)
return lambda actual: (
expected in re.split(r'\s+', actual)
if not ignore_case
else includes_ignoring_case(expected)
)


# will not work with empty seqs :( TODO: fix
# currently we use it only for non-empty seqs taking this into account
seq_compare_by = (
lambda f: lambda x=None, *xs: lambda y=None, *ys: True
if x is None and y is None
else bool(f(x)(y)) and seq_compare_by(f)(*xs)(*ys) # type: ignore
seq_compare_by = lambda f: lambda x=None, *xs: lambda y=None, *ys: (
True if x is None and y is None else bool(f(x)(y)) and seq_compare_by(f)(*xs)(*ys) # type: ignore
)


Expand Down
6 changes: 2 additions & 4 deletions selene/core/_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@


@overload
def _ensure_located(element: Element | WebElement) -> WebElement:
...
def _ensure_located(element: Element | WebElement) -> WebElement: ...


@overload
def _ensure_located(element: Element | WebElement | None) -> WebElement | None:
...
def _ensure_located(element: Element | WebElement | None) -> WebElement | None: ...


def _ensure_located(element):
Expand Down
Loading

0 comments on commit 3652eb8

Please sign in to comment.