Skip to content

Commit 7be24c6

Browse files
authored
Merge pull request #265 from beeware/autoupdates/pre-commit
Auto-update `pre-commit` hooks
2 parents 099cb36 + 8bb2fb4 commit 7be24c6

File tree

4 files changed

+6
-26
lines changed

4 files changed

+6
-26
lines changed

.pre-commit-config.yaml

+5-14
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.3.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-toml
66
- id: check-yaml
@@ -9,29 +9,20 @@ repos:
99
- id: end-of-file-fixer
1010
- id: trailing-whitespace
1111
- repo: https://github.com/PyCQA/isort
12-
# For split_on_trailing_comma. Should be in the release after 5.10.1
13-
rev: 12cc5fbd67eebf92eb2213b03c07b138ae1fb448
12+
rev: 5.12.0
1413
hooks:
1514
- id: isort
1615
additional_dependencies: [toml]
1716
- repo: https://github.com/asottile/pyupgrade
18-
rev: v2.38.2
17+
rev: v3.3.1
1918
hooks:
2019
- id: pyupgrade
2120
args: [--py36-plus]
22-
# Docformatter is RST-unaware, and may break markup by inserting or removing newlines
23-
# (see https://github.com/PyCQA/docformatter/issues/124 and linked issues). Until this
24-
# is fixed, it's not safe to run it automatically.
25-
# - repo: https://github.com/myint/docformatter
26-
# rev: v1.5.0
27-
# hooks:
28-
# - id: docformatter
29-
# args: [--in-place]
3021
- repo: https://github.com/psf/black
31-
rev: 22.8.0
22+
rev: 23.1.0
3223
hooks:
3324
- id: black
3425
- repo: https://github.com/PyCQA/flake8
35-
rev: 5.0.4
26+
rev: 6.0.0
3627
hooks:
3728
- id: flake8

changes/265.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated ``pre-commit`` hooks to the latest version.

src/rubicon/objc/api.py

-5
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ def _get_property_attributes(self):
482482
return (objc_property_attribute_t * len(attrs))(*attrs)
483483

484484
def class_register(self, class_ptr, attr_name):
485-
486485
ivar_name = "_" + attr_name
487486

488487
add_ivar(class_ptr, ivar_name, self.vartype)
@@ -519,7 +518,6 @@ def _objc_getter(objc_self, _cmd):
519518
return value
520519

521520
def _objc_setter(objc_self, _cmd, new_value):
522-
523521
if self._is_py_object and self.weak:
524522
# Don't store the object itself but only a Python weakref.
525523
new_value = weakref.ref(new_value)
@@ -575,7 +573,6 @@ def _objc_setter(objc_self, _cmd, new_value):
575573
libobjc.class_addProperty(class_ptr, ensure_bytes(attr_name), attrs, len(attrs))
576574

577575
def dealloc_callback(self, objc_self, attr_name):
578-
579576
ivar_name = "_" + attr_name
580577

581578
if self._ivar_weak:
@@ -1286,7 +1283,6 @@ def _new_from_class_statement(cls, name, bases, attrs, *, protocols):
12861283
user_dealloc = attrs.get("dealloc", None)
12871284

12881285
def _new_delloc(objc_self, _cmd):
1289-
12901286
# Invoke user-defined dealloc.
12911287
if user_dealloc:
12921288
user_dealloc(objc_self, _cmd)
@@ -2000,7 +1996,6 @@ def __subclasscheck__(self, subclass):
20001996
except NameError:
20011997

20021998
class WrappedPyObject(NSObject):
2003-
20041999
wrapped_pointer = objc_ivar(c_void_p)
20052000

20062001
@objc_rawmethod

tests/test_core.py

-7
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,6 @@ def test_class_properties(self):
11071107
NSURL = ObjCClass("NSURL")
11081108

11091109
class URLBox(NSObject):
1110-
11111110
url = objc_property(ObjCInstance)
11121111
data = objc_property(ObjCInstance)
11131112

@@ -1242,7 +1241,6 @@ class NonObjectProperties(NSObject):
12421241
self.assertEqual(r.size.height, 78)
12431242

12441243
def test_class_nonobject_properties_weak(self):
1245-
12461244
with self.assertRaises(TypeError):
12471245

12481246
class WeakNonObjectProperties(NSObject):
@@ -1253,7 +1251,6 @@ class StrongObjectProperties(NSObject):
12531251
object = objc_property(ObjCInstance)
12541252

12551253
with autoreleasepool():
1256-
12571254
properties = StrongObjectProperties.alloc().init()
12581255

12591256
obj = NSObject.alloc().init()
@@ -1272,7 +1269,6 @@ class WeakObjectProperties(NSObject):
12721269
object = objc_property(ObjCInstance, weak=True)
12731270

12741271
with autoreleasepool():
1275-
12761272
properties = WeakObjectProperties.alloc().init()
12771273

12781274
obj = NSObject.alloc().init()
@@ -1527,7 +1523,6 @@ def test_objcinstance_python_attribute_freed(self):
15271523
released."""
15281524

15291525
with autoreleasepool():
1530-
15311526
obj = NSObject.alloc().init()
15321527

15331528
# Use a custom object as attribute value so that we can keep a weak reference.
@@ -1558,7 +1553,6 @@ class TestO:
15581553
self.assertIsNone(wr_python_object())
15591554

15601555
def test_objcinstance_release_owned(self):
1561-
15621556
# Create an object which we own.
15631557
obj = NSObject.alloc().init()
15641558

@@ -1576,7 +1570,6 @@ def test_objcinstance_release_owned(self):
15761570
gc.collect()
15771571

15781572
def test_objcinstance_autorelease_owned(self):
1579-
15801573
# Create an object which we own.
15811574
obj = NSObject.alloc().init()
15821575

0 commit comments

Comments
 (0)