mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Codegen: fix autopep8 pre-commit hook
This commit is contained in:
@@ -19,7 +19,7 @@ repos:
|
||||
rev: v1.6.0
|
||||
hooks:
|
||||
- id: autopep8
|
||||
files: ^swift/.*\.py
|
||||
files: ^misc/codegen/.*\.py
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
|
||||
@@ -94,6 +94,7 @@ class _Listifier(_schema.PropertyModifier):
|
||||
raise _schema.Error(
|
||||
"list should only be applied to simple or optional property types")
|
||||
|
||||
|
||||
class _Setifier(_schema.PropertyModifier):
|
||||
def modify(self, prop: _schema.Property):
|
||||
K = _schema.Property.Kind
|
||||
|
||||
@@ -36,6 +36,7 @@ indefinite_getters = [
|
||||
("Whatever", "getAWhatever"),
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name,expected_getter", indefinite_getters)
|
||||
def test_property_indefinite_article(name, expected_getter):
|
||||
prop = ql.Property(name, plural="X")
|
||||
@@ -47,6 +48,7 @@ def test_property_unordered_getter(name, expected_getter):
|
||||
prop = ql.Property(name, plural="X", is_unordered=True)
|
||||
assert prop.getter == expected_getter
|
||||
|
||||
|
||||
@pytest.mark.parametrize("plural,expected", [
|
||||
(None, False),
|
||||
("", False),
|
||||
@@ -56,6 +58,7 @@ def test_property_is_repeated(plural, expected):
|
||||
prop = ql.Property("foo", "Foo", "props", ["result"], plural=plural)
|
||||
assert prop.is_repeated is expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize("plural,unordered,expected", [
|
||||
(None, False, False),
|
||||
("", False, False),
|
||||
|
||||
@@ -337,6 +337,7 @@ def test_repeated_property(generate_classes, is_child, prev_child):
|
||||
])),
|
||||
}
|
||||
|
||||
|
||||
def test_repeated_unordered_property(generate_classes):
|
||||
assert generate_classes([
|
||||
schema.Class("FakeRoot"),
|
||||
|
||||
Reference in New Issue
Block a user