civics-cdf-validator 1.67.dev7__tar.gz → 1.67.dev9__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.67.dev7/civics_cdf_validator.egg-info → civics_cdf_validator-1.67.dev9}/PKG-INFO +1 -1
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/civics_cdf_validator.egg-info/SOURCES.txt +1 -0
- civics_cdf_validator-1.67.dev9/rules.py +59 -0
- civics_cdf_validator-1.67.dev7/rules.py → civics_cdf_validator-1.67.dev9/rulesets/metadata_rules.py +1 -40
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/version.py +1 -1
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/CONTRIBUTING.md +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/MANIFEST.in +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/README.md +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/__init__.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/base.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/civics_cdf_validator.egg-info/requires.txt +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/civics_cdf_validator.egg-info/top_level.txt +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/gpunit_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/loggers.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/office_utils.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/__init__.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/committee_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/common_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/election_dates_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/election_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/officeholder_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/rule_util.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/voter_information_rules.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/setup.cfg +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/setup.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/stats.py +0 -0
- {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/validator.py +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Copyright 2020 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Validation rules for the CDF XML validator."""
|
|
15
|
+
|
|
16
|
+
from __future__ import print_function
|
|
17
|
+
|
|
18
|
+
import enum
|
|
19
|
+
|
|
20
|
+
from civics_cdf_validator.rulesets import committee_rules
|
|
21
|
+
from civics_cdf_validator.rulesets import common_rules
|
|
22
|
+
from civics_cdf_validator.rulesets import election_dates_rules
|
|
23
|
+
from civics_cdf_validator.rulesets import election_rules
|
|
24
|
+
from civics_cdf_validator.rulesets import metadata_rules
|
|
25
|
+
from civics_cdf_validator.rulesets import officeholder_rules
|
|
26
|
+
from civics_cdf_validator.rulesets import voter_information_rules
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RuleSet(enum.Enum):
|
|
30
|
+
"""Names for sets of rules used to validate a particular feed type."""
|
|
31
|
+
|
|
32
|
+
ELECTION = 1
|
|
33
|
+
OFFICEHOLDER = 2
|
|
34
|
+
COMMITTEE = 3
|
|
35
|
+
ELECTION_DATES = 4
|
|
36
|
+
ELECTION_RESULTS = 5
|
|
37
|
+
METADATA = 6
|
|
38
|
+
VOTER_INFORMATION = 7
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# To add new rules, create a new class in the matching file under rulesets/,
|
|
42
|
+
# inherit the base rule, and add it to that file's rule list.
|
|
43
|
+
COMMON_RULES = common_rules.COMMON_RULES
|
|
44
|
+
ELECTION_RULES = election_rules.ELECTION_RULES
|
|
45
|
+
OFFICEHOLDER_RULES = officeholder_rules.OFFICEHOLDER_RULES
|
|
46
|
+
COMMITTEE_RULES = committee_rules.COMMITTEE_RULES
|
|
47
|
+
ELECTION_DATES_RULES = election_dates_rules.ELECTION_DATES_RULES
|
|
48
|
+
METADATA_RULES = metadata_rules.METADATA_RULES
|
|
49
|
+
VOTER_INFORMATION_RULES = voter_information_rules.VOTER_INFORMATION_RULES
|
|
50
|
+
|
|
51
|
+
ALL_RULES = frozenset(
|
|
52
|
+
COMMON_RULES
|
|
53
|
+
+ ELECTION_RULES
|
|
54
|
+
+ OFFICEHOLDER_RULES
|
|
55
|
+
+ COMMITTEE_RULES
|
|
56
|
+
+ ELECTION_DATES_RULES
|
|
57
|
+
+ VOTER_INFORMATION_RULES
|
|
58
|
+
+ METADATA_RULES
|
|
59
|
+
)
|
civics_cdf_validator-1.67.dev7/rules.py → civics_cdf_validator-1.67.dev9/rulesets/metadata_rules.py
RENAMED
|
@@ -11,23 +11,17 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
"""Validation rules for the CDF XML validator."""
|
|
14
|
+
"""Validation rules for metadata feeds of the CDF XML validator."""
|
|
15
15
|
|
|
16
16
|
from __future__ import print_function
|
|
17
17
|
|
|
18
18
|
import datetime
|
|
19
|
-
import enum
|
|
20
19
|
|
|
21
20
|
from botocore import utils as botocore_utils
|
|
22
21
|
from civics_cdf_validator import base
|
|
23
22
|
from civics_cdf_validator import loggers
|
|
24
|
-
from civics_cdf_validator.rulesets import committee_rules
|
|
25
23
|
from civics_cdf_validator.rulesets import common_rules
|
|
26
|
-
from civics_cdf_validator.rulesets import election_dates_rules
|
|
27
|
-
from civics_cdf_validator.rulesets import election_rules
|
|
28
|
-
from civics_cdf_validator.rulesets import officeholder_rules
|
|
29
24
|
from civics_cdf_validator.rulesets import rule_util
|
|
30
|
-
from civics_cdf_validator.rulesets import voter_information_rules
|
|
31
25
|
import dateutil
|
|
32
26
|
from frozendict import frozendict
|
|
33
27
|
|
|
@@ -457,28 +451,6 @@ class FeedElementsShouldHaveSubElementsBasedOnType(base.BaseRule):
|
|
|
457
451
|
)
|
|
458
452
|
|
|
459
453
|
|
|
460
|
-
class RuleSet(enum.Enum):
|
|
461
|
-
"""Names for sets of rules used to validate a particular feed type."""
|
|
462
|
-
|
|
463
|
-
ELECTION = 1
|
|
464
|
-
OFFICEHOLDER = 2
|
|
465
|
-
COMMITTEE = 3
|
|
466
|
-
ELECTION_DATES = 4
|
|
467
|
-
ELECTION_RESULTS = 5
|
|
468
|
-
METADATA = 6
|
|
469
|
-
VOTER_INFORMATION = 7
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
# To add new rules, create a new class, inherit the base rule,
|
|
473
|
-
# and add it to the correct rule list.
|
|
474
|
-
COMMON_RULES = common_rules.COMMON_RULES
|
|
475
|
-
OFFICEHOLDER_RULES = officeholder_rules.OFFICEHOLDER_RULES
|
|
476
|
-
ELECTION_RULES = election_rules.ELECTION_RULES
|
|
477
|
-
ELECTION_DATES_RULES = election_dates_rules.ELECTION_DATES_RULES
|
|
478
|
-
COMMITTEE_RULES = committee_rules.COMMITTEE_RULES
|
|
479
|
-
VOTER_INFORMATION_RULES = voter_information_rules.VOTER_INFORMATION_RULES
|
|
480
|
-
|
|
481
|
-
|
|
482
454
|
METADATA_RULES = (
|
|
483
455
|
# go/keep-sorted start
|
|
484
456
|
ElectionEventDatesAreSequential,
|
|
@@ -503,14 +475,3 @@ METADATA_RULES = (
|
|
|
503
475
|
common_rules.UniqueLabel,
|
|
504
476
|
# go/keep-sorted end
|
|
505
477
|
)
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
ALL_RULES = frozenset(
|
|
509
|
-
COMMON_RULES
|
|
510
|
-
+ ELECTION_RULES
|
|
511
|
-
+ OFFICEHOLDER_RULES
|
|
512
|
-
+ COMMITTEE_RULES
|
|
513
|
-
+ ELECTION_DATES_RULES
|
|
514
|
-
+ VOTER_INFORMATION_RULES
|
|
515
|
-
+ METADATA_RULES
|
|
516
|
-
)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/committee_rules.py
RENAMED
|
File without changes
|
|
File without changes
|
{civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/election_dates_rules.py
RENAMED
|
File without changes
|
{civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/rulesets/election_rules.py
RENAMED
|
File without changes
|
{civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev9}/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
|