Skip to content
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
11 changes: 11 additions & 0 deletions .changeset/change_default_ruff_hook_to_fix_only.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
default: patch
---

# Change default Ruff hook to `--fix-only`

This should enable `openapi-python-client` to keep auto-fixing lints (like removing unused imports) but _not_ fail to
generate when unfixable lints are violated.

Since it's now unlikely for breaking changes to affect our usage (and by popular request), the upper bound of `ruff`
has been lifted. Newer versions of `openapi-python-client` should no longer be required to support newer versions of `ruff`.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ In the config file, there's an easy way to tell `openapi-python-client` to run a

```yaml
post_hooks:
- "ruff check . --fix"
- "ruff check . --fix-only"
- "ruff format ."
```

Expand Down
4 changes: 2 additions & 2 deletions openapi_python_client/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def from_sources(
post_hooks = config_file.post_hooks
elif meta_type == MetaType.NONE:
post_hooks = [
"ruff check . --fix --extend-select=I",
"ruff check . --fix-only --extend-select=I",
"ruff format .",
]
else:
post_hooks = [
"ruff check --fix .",
"ruff check --fix-only .",
"ruff format .",
]

Expand Down
42 changes: 21 additions & 21 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [
"python-dateutil>=2.8.1,<3.0.0",
"httpx>=0.23.0,<0.29.0",
"ruamel.yaml>=0.18.6,<0.19.0",
"ruff>=0.2,<0.14",
"ruff>=0.2",
]
name = "openapi-python-client"
version = "0.26.2"
Expand Down