Skip to content

Commit

Permalink
Merge pull request #33 from gdcc/change-lint-action
Browse files Browse the repository at this point in the history
Ditch archived `ruff` action
  • Loading branch information
JR-1991 authored Oct 16, 2024
2 parents d1543ab + fe33247 commit f4518a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: astral-sh/ruff-action@v1
4 changes: 2 additions & 2 deletions easyDataverse/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ def _construct_example_ds(cls, block):

for field in block.model_fields.values():
annot = field.annotation
dtype = [t for t in get_args(annot) if t != type(None)][0]
dtype = [t for t in get_args(annot) if t is not type(None)][0]
alias = field.alias

is_multiple = get_origin(annot) == list
is_multiple = get_origin(annot) is list
is_complex = hasattr(dtype, "model_fields")

if dtype.__name__ == "Annotated":
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ class TestClass(BaseModel):
# Assert
assert result[0].name == "name"
assert result[0].default.__name__ == "empty"
assert result[0].type == str
assert result[0].type is str
assert result[1].name == "value"
assert result[1].type == int
assert result[1].type is int
assert result[1].default.__name__ == "empty"
assert result[2].name == "optional"
assert result[2].type == Optional[str]
Expand Down Expand Up @@ -665,7 +665,7 @@ def test_single_cv_field(self):

# Assert
generated_enum = get_args(result)[0]
assert get_args(result)[1] == type(None)
assert get_args(result)[1] is type(None)
assert issubclass(generated_enum, Enum)
assert generated_enum.__name__ == "single_cv_field"
assert generated_enum.VALUE1.value == "value1"
Expand Down

0 comments on commit f4518a0

Please sign in to comment.