Skip to content

Commit

Permalink
Merge pull request #252 from digitronik/ruff
Browse files Browse the repository at this point in the history
Drop black and onboard ruff
  • Loading branch information
digitronik authored Apr 12, 2024
2 parents 4a0b0da + f4e186f commit 2a91369
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 36 deletions.
38 changes: 7 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
repos:
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: reorder-python-imports
language_version: python3
- id: ruff
args:
- --application-directories=.:src
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
args: [--safe, --quiet, --line-length, "100"]
language_version: python3
require_serial: true
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
language_version: python3
args:
- --max-line-length=100
- --ignore=E128,E811,W503,W504,E203
- '--fix'
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
language_version: python3
- id: end-of-file-fixer
language_version: python3
- id: debug-statements
language_version: python3
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
language_version: python3
args: [--py3-plus, --py38-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.9.0
hooks:
- id: mypy
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ strict-naming = false

[tool.hatch.version]
source = "vcs"

[tool.ruff]
line-length = 100

[tool.ruff.lint.isort]
split-on-trailing-comma = true
3 changes: 1 addition & 2 deletions src/widgetastic/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
class LocatorProtocol(Protocol):
CHECK_VISIBILITY: bool

def __locator__(self) -> Union[str, Locator, WebElement]:
...
def __locator__(self) -> Union[str, Locator, WebElement]: ...


LocatorAlias = Union[str, Dict[str, str], WebElement, LocatorProtocol, "Widget"]
Expand Down
1 change: 1 addition & 0 deletions src/widgetastic/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains some supporting classes."""

import functools
import re
import string
Expand Down
1 change: 1 addition & 0 deletions src/widgetastic/widget/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the base classes that are used to implement the more specific behaviour."""

from .base import * # noqa: F403 F401
from .checkbox import Checkbox
from .image import Image
Expand Down
6 changes: 3 additions & 3 deletions src/widgetastic/widget/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ def _get_included_widget(self, includer_id, widget_name, use_parent):
for widget_includer in self._included_widgets:
if widget_includer._seq_id == includer_id:
parent = self if use_parent else self.parent
self._initialized_included_widgets[
widget_includer._seq_id
] = widget_includer.widget_class(parent, self.logger)
self._initialized_included_widgets[widget_includer._seq_id] = (
widget_includer.widget_class(parent, self.logger)
)
break
else:
raise ValueError(f"Could not find includer #{includer_id}")
Expand Down
1 change: 1 addition & 0 deletions src/widgetastic/widget/table.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the base classes that are used to implement the more specific behaviour."""

import itertools
import re
from collections import defaultdict
Expand Down

0 comments on commit 2a91369

Please sign in to comment.