If still exist the rule after a challenge, the rule regard as cannot
 correct automatically then add to ignore list and it is not chosen as
 target rule from next time.

 @param rule [Rubocop::Rule] The corrected rule
767497
def add_to_ignore_list_if_challenge_is_incomplete(rule)
      return unless auto_correct_incomplete?(rule)

      pull_request.commit! ':police_car: add the rule to the ignore list' do
        config_editor = Rubocop::ConfigEditor.new
        config_editor.add_ignore(rule)
        config_editor.save
      end
      color_puts DESCRIPTION_THAT_CHALLENGE_IS_INCOMPLETE,
                 PrComet::CommandLine::YELLOW
    end
846399
protected function addRule(IRule $rule)
    {
        if ($this->inCondition) {
            /** @var ConditionalRule $lastRule */
            $lastRule = $this->rules[count($this->rules) - 1];
            $lastRule->addRule($rule);
        } else {
            $this->rules[] = $rule;
        }
    }
543040
def relevant_rules_for_match(self, action, subject):
        """"""
        matches = []
        for rule in self.rules:
            rule.expanded_actions = self.expand_actions(rule.actions)
            if rule.is_relevant(action, subject):
                matches.append(rule)

        return self.optimize(matches[::-1])
490939
function Rules (options) {
  this.options = options;
  this._keep = [];
  this._remove = [];

  this.blankRule = {
    replacement: options.blankReplacement
  };

  this.keepReplacement = options.keepReplacement;

  this.defaultRule = {
    replacement: options.defaultReplacement
  };

  this.array = [];
  for (var key in options.rules) this.array.push(options.rules[key]);
}
477703
public final void ruleValidID() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:833:2: ( ( ( rule__ValidID__Alternatives ) ) )
            // InternalXtext.g:834:2: ( ( rule__ValidID__Alternatives ) )
            {
            // InternalXtext.g:834:2: ( ( rule__ValidID__Alternatives ) )
            // InternalXtext.g:835:3: ( rule__ValidID__Alternatives )
            {
             before(grammarAccess.getValidIDAccess().getAlternatives()); 
            // InternalXtext.g:836:3: ( rule__ValidID__Alternatives )
            // InternalXtext.g:836:4: rule__ValidID__Alternatives
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__ValidID__Alternatives();

            state._fsp--;


            }

             after(grammarAccess.getValidIDAccess().getAlternatives()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
1282870
def add_rules(self, rules: _RuleList) -> None:
        
        for rule in rules:
            if isinstance(rule, (tuple, list)):
                assert len(rule) in (2, 3, 4)
                if isinstance(rule[0], basestring_type):
                    rule = Rule(PathMatches(rule[0]), *rule[1:])
                else:
                    rule = Rule(*rule)

            self.rules.append(self.process_rule(rule))
402147
function(rule) {
      var state = this.bt.current_state();
      try { return rule.call(this); } 
      catch(f) {
        this.bt.catch_mismatch(f);
        this.bt.restore(state);
      }
    }
387958
def with_rule(self, rule):
        
        self.rules = self.rules if self.rules != None else []
        self.rules.append(rule)
        return self
237554
public void setRules(List rules) {
        Assert.notNull(rules);
        if (logger.isDebugEnabled()) {
            logger.debug("Configuring rules in source...");
        }
        getRuleContext(DEFAULT_CONTEXT_ID).clear();
        for (Iterator i = rules.iterator(); i.hasNext();) {
            addRules((Rules) i.next());
        }
    }
1248497
def add_rule(self, rule_class, target_class=_Nothing):
        
        if isinstance(target_class, Iterable):
            for cls in target_class:
                self._rules[cls] = rule_class
        else:
            self._rules[target_class] = rule_class
1056948
def add(self, rule: 'functions.ReplacementRule') -> None:
        
        self.matcher.add(rule.pattern, rule.replacement)
36209
def execute_rule(rule, matches, context):
    
    if rule.enabled(context):
        log(rule.log_level, "Checking rule condition: %s", rule)
        when_response = rule.when(matches, context)
        if when_response:
            log(rule.log_level, "Rule was triggered: %s", when_response)
            log(rule.log_level, "Running rule consequence: %s %s", rule, when_response)
            rule.then(matches, when_response, context)
            return when_response
    else:
        log(rule.log_level, "Rule is disabled: %s", rule)
1000045
public void add(Rule rule) {
		List<Token> tokens = rule.getTokens();
		for (Token token : tokens) {
			for (String str : token.getTerms()) {
				if (str.charAt(0) != ':') {
					Library.insertWord(forest, new Value(str, "rule", "10000"));
				}
			}
		}


		for (String str : tokens.get(0).getTerms()) {
			Set<Rule> rules = ruleIndex.get(str);
			if(rules==null){
				rules = new HashSet<>() ;
				ruleIndex.put(str,rules) ;
			}
			rules.add(rule) ;
		}
	}
467844
def auto_correct_incomplete?(rule)
      todo_reader = Rubocop::TodoReader.new(options[:file_path])
      todo_reader.all_rules.include?(rule)
    end
1014662
def register_rules(self, rules):
    
    if not isinstance(rules, Iterable):
      raise TypeError('The rules must be an iterable, given {!r}'.format(rules))

    # "Index" the rules to normalize them and expand their dependencies.
    normalized_rules = RuleIndex.create(rules).normalized_rules()
    indexed_rules = normalized_rules.rules
    union_rules = normalized_rules.union_rules

    # Store the rules and record their dependency Optionables.
    self._rules.update(indexed_rules)
    self._union_rules.update(union_rules)
    dependency_optionables = {do
                              for rule in indexed_rules
                              for do in rule.dependency_optionables
                              if rule.dependency_optionables}
    self.register_optionables(dependency_optionables)
1026773
def init_rule(rule_name)
    rule_name.to_s[/^([^?!]*)([?!])?$/]
    rule_name = $1.to_sym
    option = $2
    match_rule = rules[rule_name]
    raise "no rule for #{rule_name}" unless match_rule

    self.parser = lambda {|parent_node| match_rule.parse(parent_node)}
    self.name ||= rule_name
    case option
    when "?"  then self.optional = true
    when "!"  then self.negative = true
    end
  end
679424
protected function checkRuleCorrect($rule)
    {
        if (!isset($rule->value)) {
            // We will assume a missing value for the rule is to be interpreted as empty.
            $rule->value = null;
        }
        if (!isset($rule->id, $rule->field, $rule->type, $rule->input, $rule->operator)) {
            return false;
        }
        if (!isset($this->operators[$rule->operator])) {
            return false;
        }

        return true;
    }