diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-04-10 19:10:13 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-04-10 19:10:13 +0900 |
commit | 3511c910969e613d655c67bbb4427e11a728b83e (patch) | |
tree | 6bf6d39f6a9bca2c8488197e82c742e83a12f6bc | |
parent | ca968ed30bb3f0c0d41a3182a7f7d890c2355f8e (diff) | |
download | building-blocks-3511c910969e613d655c67bbb4427e11a728b83e.tar.gz building-blocks-3511c910969e613d655c67bbb4427e11a728b83e.tar.bz2 building-blocks-3511c910969e613d655c67bbb4427e11a728b83e.zip |
RULE: Do not refer to a block not existing in this repo.submit/tizen/20170410.101333submit/tizen/20170410.101234accepted/tizen/unified/20170410.160351
- Added a rule
- Added the rule check in rule checker
- Corrected violating blocks.
Change-Id: I5e1006a1dafeb35a5344a2da8e1eef316898d3ff
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
-rw-r--r-- | RULES | 2 | ||||
-rw-r--r-- | packaging/domain-hal.inc | 28 | ||||
-rw-r--r-- | packaging/platform-preset-iot.inc | 2 | ||||
-rwxr-xr-x | rule_checker.py | 16 |
4 files changed, 46 insertions, 2 deletions
@@ -56,6 +56,8 @@ other blocks to populate themselves with higher readability. Refer to RULE 5-4. +2.7. Do not refer to (or declare as a child) a block that does not exist + in this repository. =========================================================================== diff --git a/packaging/domain-hal.inc b/packaging/domain-hal.inc index 028cbdb..358f4f0 100644 --- a/packaging/domain-hal.inc +++ b/packaging/domain-hal.inc @@ -121,6 +121,21 @@ Tizen Audio HAL domain %files sub1-domain_HAL-audio +%package sub2-domain_HAL-audio-odroid +Summary: HAL packages for Odroid AUdio +%description sub2-domain_HAL-audio-odroid +%files sub2-domain_HAL-audio-odroid + +%package sub2-domain_HAL-audio-TM2 +Summary: HAL packages for TM2 Audio +%description sub2-domain_HAL-audio-TM2 +%files sub2-domain_HAL-audio-TM2 + +%package sub2-domain_HAL-audio-TM1 +Summary: HAL packages for TM1 Audio +%description sub2-domain_HAL-audio-TM1 +%files sub2-domain_HAL-audio-TM1 + @@ -133,4 +148,17 @@ Suggests: %{name}-sub2-domain_HAL-bluetooth-TM1 Tizen Bluetooth HAL domain %files sub1-domain_HAL-bluetooth + +%package sub2-domain_HAL-bluetooth-TM2 +Summary: HAL packages for TM2 Bluetooth +%description sub2-domain_HAL-bluetooth-TM2 +%files sub2-domain_HAL-bluetooth-TM2 + + +%package sub2-domain_HAL-bluetooth-TM1 +Summary: HAL packages for TM1 Bluetooth +%description sub2-domain_HAL-bluetooth-TM1 +%files sub2-domain_HAL-bluetooth-TM1 + + # END diff --git a/packaging/platform-preset-iot.inc b/packaging/platform-preset-iot.inc index a21ea06..555019f 100644 --- a/packaging/platform-preset-iot.inc +++ b/packaging/platform-preset-iot.inc @@ -85,7 +85,7 @@ Suggests: cmake Summary: RPI3 Headless Network Hub Requires: %{name}-sub2-Preset_iot-platforms-headless_minimal Requires: %{name}-sub1-Preset_boards-RPI3_headlessBSP -Requires: %{name}-root-network +Requires: %{name}-root-domain_network %description sub2-Preset_iot-examples-RPI3_headless_networkhub %files sub2-Preset_iot-examples-RPI3_headless_networkhub %endif diff --git a/rule_checker.py b/rule_checker.py index 910f680..2578d5f 100755 --- a/rule_checker.py +++ b/rule_checker.py @@ -23,6 +23,7 @@ def print_v(*args): Block = collections.namedtuple('Block', 'name level parent children description files') blocks = {} +referedblock = [] def report(file, lc, code): print(file + ":Line " + str(lc) + " |"+code) @@ -30,6 +31,8 @@ def report(file, lc, code): def ruleCheckInterBlock(): global blocks + global referedblock + error = 0 warning = 0 root_suggested = {} @@ -70,15 +73,24 @@ def ruleCheckInterBlock(): if found == 0: error += 1 print("ERROR: Orphaned sub block. The block "+n+" is not registered at the parent block "+p+" although "+p+" exists.") - # TODO: Add more rules here? + # Check if Required/Suggested blocks exist in this repo + for refered in referedblock: + if not refered in blocks: + error += 1 + print("ERROR: A nonexisting block '"+refered+"' is refered.") + + + + return (error, warning) def ruleCheckInc(file): global blocks + global referedblock print_v("Checking "+file) @@ -153,6 +165,8 @@ def ruleCheckInc(file): report(file, lc, line) continue + referedblock.append(cname[5:].strip()) + cs = blocks[n].children cs.append(c) blocks[n]._replace(children = cs) |