Skip to content

Ruff 2.0 Changes #1712

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Merged
merged 3 commits into from
Sep 6, 2024
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: requirements-txt-fixer
name: Requirements
Expand Down Expand Up @@ -30,13 +30,13 @@ repos:
- id: check-merge-conflict
name: Merge Conflicts
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.2'
rev: 'v0.4.3'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
language: python
- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.4.2
hooks:
- id: black
name: Black Formatting
Expand Down
2 changes: 1 addition & 1 deletion interactions/api/gateway/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ async def dispatch_event(self, data, seq, event) -> None:
return None

case "GUILD_MEMBERS_CHUNK":
_ = asyncio.create_task(self._process_member_chunk(data.copy()))
_ = asyncio.create_task(self._process_member_chunk(data.copy())) # noqa: RUF006

case _:
# the above events are "special", and are handled by the gateway itself, the rest can be dispatched
Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"]

[tool.coverage.run]
omit = ["tests/*"]
source = ["interactions"]

[build-system]
requires = ["setuptools", "tomli"]
build-backend = "setuptools.build_meta"

[tools.coverage.run]
source = ["interactions"]

[tool.pytest.ini_options]
addopts = "-l -ra --durations=2 --junitxml=TestResults.xml"
doctest_optionflags = "NORMALIZE_WHITESPACE"
Expand All @@ -113,9 +111,11 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
[tool.ruff]
line-length = 120
target-version = "py310"
output-format = "concise" # set to full if you want to see the source of the error/warning

[tool.ruff.lint]
ignore-init-module-imports = true
task-tags = ["TODO", "FIXME", "XXX", "HACK", "REVIEW", "NOTE"]
show-source = false # set to true if you want to see the source of the error/warning
select = ["E", "F", "B", "Q", "RUF", "D", "ANN", "RET", "C"]
ignore = [
"Q0",
Expand Down Expand Up @@ -177,16 +177,16 @@ ignore = [
# unecessary variable assignement before return statement.
]

[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"

[tool.ruff.flake8-annotations]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
suppress-dummy-args = true
suppress-none-returning = true

[tool.ruff.flake8-errmsg]
[tool.ruff.lint.flake8-errmsg]
max-string-length = 20

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 13
Loading