Skip to content

Commit

Permalink
fix: Ruff check command typo breaks generator (#1061)
Browse files Browse the repository at this point in the history
* fix: Typo in ruff check command

* fix: Ruff check command typo breaks generator
  • Loading branch information
tefra authored Jun 28, 2024
1 parent d091f23 commit 3ad50f2
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repos:
- id: typos
exclude: ^tests/|.xsd|xsdata/models/datatype.py$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.5.0
hooks:
- id: ruff
args: [ --fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.10.1
hooks:
- id: mypy
files: ^(xsdata/)
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 24.6.1 (2024-06-28)

**Fixes**

- Ruff check command typo breaks generator with v0.5.0
([#1061](https://github.com/tefra/xsdata/pull/1061))

## 24.6 (2024-06-24)

**Features**
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ Check the [documentation](https://xsdata.readthedocs.io) for more ✨✨✨
- Support xinclude statements and unknown properties
- Customize behaviour through config

## Changelog: 24.6.1 (2024-06-28)

**Fixes**

- Ruff check command typo breaks generator with v0.5.0
([#1061](https://github.com/tefra/xsdata/pull/1061))

## Changelog: 24.6 (2024-06-24)

**Features**
Expand Down
2 changes: 1 addition & 1 deletion tests/formats/dataclass/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

def test_evaluate_with_typevar():
result = evaluate(Type["str"], None)
assert str == result
assert result is str

with pytest.raises(TypeError):
evaluate(Type, None)
Expand Down
2 changes: 1 addition & 1 deletion xsdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "24.6"
__version__ = "24.6.1"
5 changes: 1 addition & 4 deletions xsdata/codegen/handlers/disambiguate_choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ def is_simple_type(self, choice: Attr) -> bool:
return True

source = self.container.find(choice.types[0].qname)
if source and source.is_enumeration:
return True

return False
return bool(source and source.is_enumeration)

def create_ref_class(self, source: Class, choice: Attr, inner: bool) -> Class:
"""Create an intermediate class for the given choice.
Expand Down
16 changes: 8 additions & 8 deletions xsdata/codegen/handlers/flatten_class_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,14 @@ def should_flatten_extension(cls, source: Class, target: Class) -> bool:
source: The source class instance
target: The target class instance
"""
if not source.extensions and (
not source.is_complex_type
or target.has_suffix_attr
or (source.has_suffix_attr and target.attrs)
):
return True

return False
return bool(
not source.extensions
and (
not source.is_complex_type
or target.has_suffix_attr
or (source.has_suffix_attr and target.attrs)
)
)

@classmethod
def have_unordered_sequences(
Expand Down
2 changes: 1 addition & 1 deletion xsdata/formats/dataclass/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def ruff_code(self, file_paths: List[str]):
],
[
"ruff",
"checks",
"check",
"--line-length",
str(self.config.output.max_line_length),
"--config",
Expand Down

0 comments on commit 3ad50f2

Please sign in to comment.