Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.15.z] [pre-commit.ci] pre-commit autoupdate (#1645) #1666

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion airgun/views/contentviewfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CVFEditableEntry(EditableEntry):

def __init__(self, parent, locator=None, name=None, logger=None):
"""Supports initialization via ``locator=`` or ``name=``"""
if locator and name or not locator and not name:
if (locator and name) or (not locator and not name):
raise TypeError('Please specify either locator or name')
locator = (
locator
Expand Down
4 changes: 3 additions & 1 deletion airgun/views/redhat_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ def items(self, name=None, label=None):
items = []
for index, _ in enumerate(self.browser.elements(self.ITEMS, parent=self)):
item = self.ITEM_WIDGET(self, f'{self.ITEMS}[{index + 1}]')
if name is not None and item.name != name or label is not None and item.label != label:
if (name is not None and item.name != name) or (
label is not None and item.label != label
):
continue
items.append(item)
return items
Expand Down
17 changes: 7 additions & 10 deletions airgun/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class MultiSelect(GenericLocatorWidget):

def __init__(self, parent, locator=None, id=None, logger=None):
"""Supports initialization via ``locator=`` or ``id=``"""
if locator and id or not locator and not id:
if (locator and id) or (not locator and not id):
raise TypeError('Please specify either locator or id')
locator = locator or f".//div[@id='{id}']"
super().__init__(parent, locator, logger)
Expand Down Expand Up @@ -554,7 +554,7 @@ class PF4MultiSelect(GenericLocatorWidget):

def __init__(self, parent, locator=None, id=None, logger=None):
"""Supports initialization via ``locator=`` or ``id=``"""
if locator and id or not locator and not id:
if (locator and id) or (not locator and not id):
raise TypeError('Please specify either locator or id')
locator = locator or f".//div[@id='{id}']"
super().__init__(parent, locator, logger)
Expand Down Expand Up @@ -1161,7 +1161,7 @@ class FilteredDropdown(GenericLocatorWidget):

def __init__(self, parent, id=None, locator=None, logger=None):
"""Supports initialization via ``id=`` or ``locator=``"""
if locator and id or not locator and not id:
if (locator and id) or (not locator and not id):
raise ValueError('Please specify either locator or id')
locator = locator or f".//div[contains(@id, '{id}')]"
super().__init__(parent, locator, logger)
Expand Down Expand Up @@ -1235,11 +1235,8 @@ class CustomParameter(Table):

def __init__(self, parent, **kwargs):
"""Supports initialization via ``locator=`` or ``id=``"""
if (
kwargs.get('locator')
and kwargs.get('id')
or not kwargs.get('locator')
and not kwargs.get('id')
if (kwargs.get('locator') and kwargs.get('id')) or (
not kwargs.get('locator') and not kwargs.get('id')
):
raise ValueError('Please specify either locator or id')
locator = kwargs.get('locator') or f".//table[@id='{kwargs.pop('id')}']"
Expand Down Expand Up @@ -1579,7 +1576,7 @@ class EditableEntry(GenericLocatorWidget):

def __init__(self, parent, locator=None, name=None, logger=None):
"""Supports initialization via ``locator=`` or ``name=``"""
if locator and name or not locator and not name:
if (locator and name) or (not locator and not name):
raise TypeError('Please specify either locator or name')
locator = locator or f".//dt[normalize-space(.)='{name}']/following-sibling::dd[1]"
super().__init__(parent, locator, logger)
Expand Down Expand Up @@ -1735,7 +1732,7 @@ class ReadOnlyEntry(GenericLocatorWidget):

def __init__(self, parent, locator=None, name=None, logger=None):
"""Supports initialization via ``locator=`` or ``name=``"""
if locator and name or not locator and not name:
if (locator and name) or (not locator and not name):
raise TypeError('Please specify either locator or name')
locator = locator or self.BASE_LOCATOR.format(name)
super().__init__(parent, locator, logger)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ select = [
"T100", # Trace found: {name} used
"T20", # flake8-print
"TRY004", # Prefer TypeError exception for invalid type
"TRY302", # Remove exception handler; error is immediately re-raised
"TRY203", # Remove exception handler; error is immediately re-raised
"PLR0911", # Too many return statements ({returns} > {max_returns})
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
Expand Down
Loading