civics-cdf-validator 1.68.dev12__tar.gz → 1.68.dev13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {civics_cdf_validator-1.68.dev12/civics_cdf_validator.egg-info → civics_cdf_validator-1.68.dev13}/PKG-INFO +1 -1
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/common_rules.py +4 -4
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_rules.py +1 -1
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/version.py +1 -1
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/README.md +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/__init__.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/base.py +9 -9
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/loggers.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/office_utils.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/__init__.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/committee_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_dates_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_results_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/metadata_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/officeholder_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/rule_util.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/voter_information_rules.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/setup.cfg +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/setup.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/stats.py +0 -0
- {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/validator.py +0 -0
{civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/common_rules.py
RENAMED
|
@@ -243,7 +243,7 @@ class EmptyText(base.BaseRule):
|
|
|
243
243
|
raise loggers.ElectionError.from_message("Text is empty", element)
|
|
244
244
|
|
|
245
245
|
|
|
246
|
-
class EmptyString(base.
|
|
246
|
+
class EmptyString(base.SchemaRule):
|
|
247
247
|
"""Check that string fields are not empty or strictly whitespace."""
|
|
248
248
|
|
|
249
249
|
def elements(self):
|
|
@@ -599,7 +599,7 @@ class OtherType(base.BaseRule):
|
|
|
599
599
|
raise loggers.ElectionError.from_message(msg, [element])
|
|
600
600
|
|
|
601
601
|
|
|
602
|
-
class UniqueLabel(base.
|
|
602
|
+
class UniqueLabel(base.SchemaRule):
|
|
603
603
|
"""Labels should be unique within a file."""
|
|
604
604
|
|
|
605
605
|
def __init__(self, *args, **kwargs):
|
|
@@ -1742,7 +1742,7 @@ class MissingOfficeSelectionMethod(base.BaseRule):
|
|
|
1742
1742
|
)
|
|
1743
1743
|
|
|
1744
1744
|
|
|
1745
|
-
class AllInternationalizedTextHaveEnVersion(base.
|
|
1745
|
+
class AllInternationalizedTextHaveEnVersion(base.SchemaRule):
|
|
1746
1746
|
"""Checks for InternationalizedText elements missing an English version."""
|
|
1747
1747
|
|
|
1748
1748
|
def elements(self):
|
|
@@ -1811,7 +1811,7 @@ class ProhibitElectionData(base.TreeRule):
|
|
|
1811
1811
|
)
|
|
1812
1812
|
|
|
1813
1813
|
|
|
1814
|
-
class UnreferencedEntitiesBase(base.TreeRule):
|
|
1814
|
+
class UnreferencedEntitiesBase(base.TreeRule, base.SchemaRule):
|
|
1815
1815
|
"""All non-top-level entities in a feed should be referenced by at least one other entity.
|
|
1816
1816
|
|
|
1817
1817
|
In the context of this rule, top-level means that an entity is not expected to
|
{civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_rules.py
RENAMED
|
@@ -716,7 +716,7 @@ class VoteCountTypesCoherency(base.BaseRule):
|
|
|
716
716
|
raise loggers.ElectionError.from_message(msg, [element])
|
|
717
717
|
|
|
718
718
|
|
|
719
|
-
class VoteCountValidSeatsDeltaTypes(base.
|
|
719
|
+
class VoteCountValidSeatsDeltaTypes(base.SchemaRule):
|
|
720
720
|
"""Ensure VoteCount seats delta types are valid."""
|
|
721
721
|
|
|
722
722
|
def elements(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -97,6 +97,15 @@ class BaseRule(SchemaHandler):
|
|
|
97
97
|
def setup(self):
|
|
98
98
|
"""Perform any rule specific setup before checking."""
|
|
99
99
|
|
|
100
|
+
|
|
101
|
+
class SchemaRule(BaseRule):
|
|
102
|
+
"""Rule that needs the schema tree to be present."""
|
|
103
|
+
|
|
104
|
+
def __init__(self, *args, **kwargs):
|
|
105
|
+
super(SchemaRule, self).__init__(*args, **kwargs)
|
|
106
|
+
if self.schema_tree is None:
|
|
107
|
+
raise ValueError(f"{type(self).__name__} requires a schema_tree.")
|
|
108
|
+
|
|
100
109
|
def get_element_names_for_types(self, element_types: Set[str]) -> set[str]:
|
|
101
110
|
element_names = set()
|
|
102
111
|
for _, element in etree.iterwalk(self.schema_tree):
|
|
@@ -138,15 +147,6 @@ class BaseRule(SchemaHandler):
|
|
|
138
147
|
return subtypes
|
|
139
148
|
|
|
140
149
|
|
|
141
|
-
class SchemaRule(BaseRule):
|
|
142
|
-
"""Rule that needs the schema tree to be present."""
|
|
143
|
-
|
|
144
|
-
def __init__(self, *args, **kwargs):
|
|
145
|
-
super(SchemaRule, self).__init__(*args, **kwargs)
|
|
146
|
-
if self.schema_tree is None:
|
|
147
|
-
raise ValueError(f"{type(self).__name__} requires a schema_tree.")
|
|
148
|
-
|
|
149
|
-
|
|
150
150
|
class TreeRule(BaseRule):
|
|
151
151
|
"""Rule that checks entire tree."""
|
|
152
152
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/committee_rules.py
RENAMED
|
File without changes
|
{civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_dates_rules.py
RENAMED
|
File without changes
|
|
File without changes
|
{civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/metadata_rules.py
RENAMED
|
File without changes
|
{civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/officeholder_rules.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|