Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolab committed Aug 22, 2024
1 parent 6a43e7d commit c4db925
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
- uses: actions/checkout@v4

# keep in sync with .pre-commit-config.yaml
- run: python -Im pip install --user ruff==0.4.8
- run: python -Im pip install --user ruff==0.6.1

- name: Run ruff
working-directory: .
run: ruff --output-format=github wagtail_localize
run: ruff check --output-format=github wagtail_localize
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# keep in sync with .github/workflows/ruff.yml
rev: 'v0.4.8'
rev: 'v0.6.1'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
7 changes: 2 additions & 5 deletions wagtail_localize/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,9 @@ def ignore_if_at_end(element):

# Ignore if there are no text nodes
# This will exclude both <br> tags and empty inline tags
if not any(
return not any(
isinstance(desc, NavigableString) for desc in element.descendants
):
return True

return False
)

if ignore_if_at_end(elements[0]):
wrap(elements[1:])
Expand Down

0 comments on commit c4db925

Please sign in to comment.