Skip to content

Commit 83fef88

Browse files
Ruff 2.0 Changes (#1712)
* Fix typo in pyproject.toml * ci: weekly check. updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0) - [github.com/astral-sh/ruff-pre-commit: v0.3.2 → v0.4.3](astral-sh/ruff-pre-commit@v0.3.2...v0.4.3) - [github.com/psf/black: 24.2.0 → 24.4.2](psf/black@24.2.0...24.4.2) * Update pyproject.toml for ruff 0.2.0's breaking changes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 369a291 commit 83fef88

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v4.6.0
44
hooks:
55
- id: requirements-txt-fixer
66
name: Requirements
@@ -30,13 +30,13 @@ repos:
3030
- id: check-merge-conflict
3131
name: Merge Conflicts
3232
- repo: https://github.com/astral-sh/ruff-pre-commit
33-
rev: 'v0.3.2'
33+
rev: 'v0.4.3'
3434
hooks:
3535
- id: ruff
3636
args: [--fix, --exit-non-zero-on-fix]
3737
language: python
3838
- repo: https://github.com/psf/black
39-
rev: 24.2.0
39+
rev: 24.4.2
4040
hooks:
4141
- id: black
4242
name: Black Formatting

interactions/api/gateway/gateway.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ async def dispatch_event(self, data, seq, event) -> None:
223223
return None
224224

225225
case "GUILD_MEMBERS_CHUNK":
226-
_ = asyncio.create_task(self._process_member_chunk(data.copy()))
226+
_ = asyncio.create_task(self._process_member_chunk(data.copy())) # noqa: RUF006
227227

228228
case _:
229229
# the above events are "special", and are handled by the gateway itself, the rest can be dispatched

pyproject.toml

+7-5
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
111111
[tool.ruff]
112112
line-length = 120
113113
target-version = "py310"
114+
output-format = "concise" # set to full if you want to see the source of the error/warning
115+
116+
[tool.ruff.lint]
114117
ignore-init-module-imports = true
115118
task-tags = ["TODO", "FIXME", "XXX", "HACK", "REVIEW", "NOTE"]
116-
show-source = false # set to true if you want to see the source of the error/warning
117119
select = ["E", "F", "B", "Q", "RUF", "D", "ANN", "RET", "C"]
118120
ignore = [
119121
"Q0",
@@ -175,16 +177,16 @@ ignore = [
175177
# unecessary variable assignement before return statement.
176178
]
177179

178-
[tool.ruff.flake8-quotes]
180+
[tool.ruff.lint.flake8-quotes]
179181
docstring-quotes = "double"
180182

181-
[tool.ruff.flake8-annotations]
183+
[tool.ruff.lint.flake8-annotations]
182184
mypy-init-return = true
183185
suppress-dummy-args = true
184186
suppress-none-returning = true
185187

186-
[tool.ruff.flake8-errmsg]
188+
[tool.ruff.lint.flake8-errmsg]
187189
max-string-length = 20
188190

189-
[tool.ruff.mccabe]
191+
[tool.ruff.lint.mccabe]
190192
max-complexity = 13

0 commit comments

Comments
 (0)