-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from srfoster65:ruff
Support Ruff linter
- Loading branch information
Showing
27 changed files
with
355 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: lint | ||
|
||
on: | ||
- push | ||
- workflow_call | ||
|
||
jobs: | ||
build: | ||
name: ruff | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup PDM | ||
uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: 3.11 | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: pdm install -G test | ||
|
||
- name: Run Ruff check | ||
run: pdm run ruff check . | ||
|
||
- name: Run Ruff format | ||
run: pdm run ruff format . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
}, | ||
"python.formatting.provider": "none" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
""" | ||
mypy type aliases | ||
""" | ||
"""mypy type aliases.""" | ||
|
||
from typing import Any, Optional, Callable | ||
from collections.abc import Callable | ||
from typing import Any | ||
|
||
from ._arg_defaults import ArgDefaults | ||
from ._priority import Priority | ||
|
||
Defaults = Optional[list[ArgDefaults]] | ||
Priorities= tuple[Priority, Priority, Priority, Priority] | ||
ClassCallback = Callable[[Any], None] | ||
Defaults = list[ArgDefaults] | None | ||
LoaderCallback = Callable[[Any], dict[Any, Any]] | ||
Priorities = tuple[Priority, Priority, Priority, Priority] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,16 @@ | ||
""" | ||
Dataclass torepresent argument defaults that may be overridden | ||
on a per argument basis. | ||
""" | ||
"""Dataclass torepresent argument defaults that may be overridden on a per argument basis.""" | ||
|
||
from dataclasses import dataclass | ||
from typing import Any | ||
|
||
|
||
@dataclass | ||
class ArgDefaults: | ||
""" | ||
Dataclass to represent argument defaults that may be overridden | ||
on a per argument basis. | ||
""" | ||
"""Dataclass to represent argument defaults that may be overridden on a per argument basis.""" | ||
|
||
name: str | ||
default_value: Any | None = None | ||
alt_name: str | None = None | ||
|
||
def __repr__(self) -> str: | ||
return ( | ||
f"<ArgDefaults(name={self.name}, " | ||
f"default_value={self.default_value}, " | ||
f"alt_name={self.alt_name})>" | ||
) | ||
return f"<ArgDefaults(name={self.name}, default_value={self.default_value}, alt_name={self.alt_name})>" |
Oops, something went wrong.