Skip to content

Commit

Permalink
Update ruff to 0.6.9 (#17940)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored Oct 14, 2024
1 parent c8ebc75 commit 5fba078
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: black
exclude: '^(test-data/)'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0 # must match test-requirements.txt
rev: v0.6.9 # must match test-requirements.txt
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion mypy/fastparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ def visit_UnaryOp(self, n: UnaryOp) -> Type:
if (
isinstance(typ, RawExpressionType)
# Use type() because we do not want to allow bools.
and type(typ.literal_value) is int # noqa: E721
and type(typ.literal_value) is int
):
if isinstance(n.op, USub):
typ.literal_value *= -1
Expand Down
3 changes: 1 addition & 2 deletions mypy/ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

if sys.platform == "win32":
# This may be private, but it is needed for IPC on Windows, and is basically stable
import ctypes

import _winapi
import ctypes

_IPCHandle = int

Expand Down
2 changes: 1 addition & 1 deletion mypy/server/astmerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def replacement_map_from_symbol_table(
):
new_node = new[name]
if (
type(new_node.node) == type(node.node) # noqa: E721
type(new_node.node) == type(node.node)
and new_node.node
and node.node
and new_node.node.fullname == node.node.fullname
Expand Down
2 changes: 1 addition & 1 deletion mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def _verify_arg_default_value(
stub_default != runtime_arg.default
# We want the types to match exactly, e.g. in case the stub has
# True and the runtime has 1 (or vice versa).
or type(stub_default) is not type(runtime_arg.default) # noqa: E721
or type(stub_default) is not type(runtime_arg.default)
)
):
yield (
Expand Down
3 changes: 1 addition & 2 deletions mypy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
from typing_extensions import Literal

try:
import curses

import _curses # noqa: F401
import curses

CURSES_ENABLED = True
except ImportError:
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ ignore = [
"E2", # conflicts with black
"E402", # module level import not at top of file
"E501", # conflicts with black
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
"E731", # Do not assign a `lambda` expression, use a `def`
"E741", # Ambiguous variable name
"UP031", # Use format specifiers instead of percent format
"UP032", # 'f-string always preferable to format' is controversial
"C416", # There are a few cases where it's nice to have names for the dict items
]
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ psutil>=4.0
pytest>=8.1.0
pytest-xdist>=1.34.0
pytest-cov>=2.10.0
ruff==0.2.0 # must match version in .pre-commit-config.yaml
ruff==0.6.9 # must match version in .pre-commit-config.yaml
setuptools>=65.5.1
tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.8
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pytest-cov==4.1.0
# via -r test-requirements.in
pytest-xdist==3.3.1
# via -r test-requirements.in
ruff==0.2.0
ruff==0.6.9
# via -r test-requirements.in
tomli==2.0.1
# via -r test-requirements.in
Expand Down

0 comments on commit 5fba078

Please sign in to comment.