acheck-rules (5) - Linux Man Pages
acheck-rules: Rules set for acheck
set.rules - Rules set for acheck
DESCRIPTIONRules set files contain rules to be check by acheck.
Lines beginning with a number sign (`#') and empty lines will be ignored. Spaces at the beginning and the end of a line will also be ignored as well as tabulators. If you need spaces at the end or the beginning of a value you can use apostrophes (`"'). A comment starts with the number sign, there can be any number of spaces and/or tab stops in front of the #. Long lines can be broken into multiple lines ending with a backslash (`\'). Some possible examples:
# this line is ignored field value field value # this is a comment field "value ending with space " field value\ continuing on the next line
You have to escape number signs with a backslash to use it in a value and use apostrophes if a value ends with a backslash.
Rule sets are made of lists of rules. Theses lists can be repeated a number of times, until or while a condition happens.
A rule detects an error if the corresponding test succeeds and none of its validation tests does. Each rule can then produce some fixes, a warning or an error, and provide hints to help the operator to correct the error.
RULE FILE SYNTAX
listA list starts at a `list' statement, and stops at the first `end_list' or at the end of the file.
- type type
- test regex / number
- A regex for `until' and `while' lists. The number of times the list must be performed for `loop', or `0' for infinite loop.
- name name
- Use this to give the list a name.
- spell yes / no
- Set it to `yes' (default) or `no', if you want or don't want spelling to be checked in the lines matching this list. This value will be inherited by the nested lists.
- list [name]
- rule [name]
- comment [name]
- Followed by the name of the sub-rule or its definition for an anonymous sub-rule.
ruleA rule starts at a `rule' statement, and stops at the first `end_rule' or at the beginning of a comment or a list.
- type type
- regex regex
- The regex to be match to found this error. Patterns can be captures and then used in the `fix' expression.
- fix expr
- Provides a correction for the rule, this field can be repeated to provides more than one choice. Only the first one will be used for `autofix' rules. `warning' and `error' do not provides fixes. The captured patterns can be used here with variables `$1', `$2', and so on.
- hint text
- Provides some explanations, this will be used as reviewer comments in review mode.
- name name
- Use this to give the rule a name.
- valid [name]
- Provides a validation test, it can be named or anonymous. For anonymous validation, the test definition must follow. This field can be repeated more than once, if any of the validation test succeed, the rule does not apply.
validA validation test starts at a `valid' statement, and stops at the first `end_valid' or at the beginning of a rule, a comment, a list or another validation test.
- pre regex
- in regex>
- post regex
- Try the regex before, in or after the match of the regex rule. At least one of these test must be provided. If all tests are successful, the rule won't apply.
commentA comment starts at a `comment' statement, and stops at the first `end_comment' or at the beginning of a rule, a comment or a list.
Comments are just skipped, no other rule and no spelling are performed on them.
- skip regex
- A regex matching the text of the comment. Do not use `start' and `stop' with this.
- start regex
- stop regex
- Regexs defining the beginning and the end of the comment, all the text between will be considered as comment. Do not use `skip' with this.
- name name
- Use this to give the comment a name.
- Defines where the comment really starts or end. Values are `s' for the place the match starts, `s+<n>' for n characters after the match starts, `e' for the place the match ends, or `e-<n>' for n characters before the match ends. Defaults are `s' for `start' matches and `e' for `stop' matches.
AUTHORNicolas Bertolissio <nico.bertol [at] free.fr>