Allow footprint.5c checks to be overridden
authorKeith Packard <keithp@keithp.com>
Mon, 28 Mar 2016 02:50:45 +0000 (19:50 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 28 Mar 2016 02:50:45 +0000 (19:50 -0700)
Some packages do 'odd' things and need to turn off the normal rule
checking

Signed-off-by: Keith Packard <keithp@keithp.com>
packages/footprint.5c

index 5414a4723b65b6d697100e8a89ce58fe4868ff07..ec8ff2516a739820b1d419e1e5f6621be945114f 100644 (file)
@@ -46,6 +46,16 @@ namespace Footprint {
 
        string tmp_name;
 
+       bool[string] override_rules = {};
+
+       public void override(string rule) {
+               override_rules[rule] = true;
+       }
+
+       bool overridden(string rule) {
+               return hash_test(override_rules, rule) && override_rules[rule];
+       }
+
        public void element_start(string name) {
 
                if (!is_uninit(&out_name)) {
@@ -170,6 +180,9 @@ namespace Footprint {
        public exception violation(string rule, real min, real val);
 
        public check(string rule, real min, real val, bool zero_ok) {
+
+               if (overridden(rule))
+                       return;
                if (zero_ok && val <= 0)
                        return;
                if (val < min) {