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