ACHECK-RULES.5(5)
π ACHECK-RULES 5 β set.rules π
okay bestie, this is the acheck-rules page (that's acheck-rules.5, section 5, we're in the perl-contributed-docs corner of the man cave β¨), and it's literally the blueprint for every set.rules file you're ever gonna write. no cap.
πΈ NAME πΈ
set.rules β the rules set for acheck. that's it, that's the whole name, iconic π
β¨ DESCRIPTION β¨
so. rules set files contain rules to be checked by acheck. that's the whole vibe.
now the parsing tea, and this part is important, don't skim it π«Ά:
- lines starting with a number sign (
#) get ignored. so do empty lines. - spaces at the beginning and the end of a line are ignored too, and tabulators as well.
- if you need spaces at the end or the beginning of a value, use apostrophes (
"). - a comment starts with the number sign, and there can be any number of spaces and/or tab stops in front of the
#. so it's giving very forgiving. - long lines can be broken into multiple lines by ending with a backslash (
\).
some possible examples, look at her:
# this line is ignored
field value
field value # this is a comment
field "value ending with space "
field value\
continuing on the next line
and the escape lore: you have to escape number signs with a backslash to use one in a value, and use apostrophes if a value ends with a backslash. yes it's a little picky, she's worth it π
rule sets are made of lists of rules. these lists can be repeated a number of times, until or while a condition happens. like a playlist that loops π
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. main character behaviour honestly π
and parts of the text can be set as comments, so no rule and no spell check will be performed on them. safe little bubble π«§
π RULE FILE SYNTAX π
π¦ SYNTAX RULES π¦
π list π
a list starts at a list statement, and stops at the first end_list or at the end of the file. periodt.
mandatory fields:
typetype β pick your girl:untilβ perform the list until the current line matchestestwhileβ perform the lint while the current line matchestestloopβ perform the listtesttimes
testregex / number β a regex foruntilandwhilelists. the number of times the list must be performed forloop, or0for infinite loop. yes bestie,0means forever, watch yourself π
optional fields:
namename β use this to give the list a name. she deserves one πspellyes / no β set it toyes(default) orno, 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. it's giving generational trauma but make it config π
sub-rules:
list [name]rule [name]comment [name]
followed by the name of the sub-rule or its definition for an anonymous sub-rule. mystery girl energy π
β rule β
a rule starts at a rule statement, and stops at the first end_rule or at the beginning of a comment or a list.
mandatory fields:
typetype βfixβ rule provides fixes and hints thought a menuautofixβ rule fixes the mistake with no interactionwarningβ rule issues a warningerrorβ rule issues an errornopβ special rule that do nothing, no other field is required (the slacker of the group, we love her)
regexregex β the regex to be match to found this error. patterns can be captures and then used in thefixexpression. grab those groups bestie π«΄
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.
optional fields:
namename β 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. (read that twice, it's lowkey the whole plot twist π)
π§ valid π§
a 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.
mandatory field:
preregexin regex>postregex
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. yes, successful means it bails, don't ask, just trust the process π
optional field:
namename β use this to give the validation test a name.
π comment π
a 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. she's off the grid, respect it π«Ά
mandatory field:
skipregex β a regex matching the text of the comment. do not usestartandstopwith this.startregex /stopregex β regexs defining the beginning and the end of the comment, all the text between will be considered as comment. do not useskipwith this.
optional fields:
namename β use this to give the comment a name.start_offset/stop_offsetβ defines where the comment really starts or end. values aresfor the place the match starts,s+<n>for n characters after the match starts,efor the place the match ends, ore-<n>for n characters before the match ends. defaults aresforstartmatches andeforstopmatches. precision girly π
π SEE ALSO π
π AUTHOR π
Nicolas Bertolissio <nico.bertol@free.fr> β thank you for your service, king π«‘
okay that's the whole page bestie, go write some rules, you're gonna ate πβ¨
and a lil sign-off for the record: this is from perl v5.40.1, dated 2025-12-23 β you're welcome, mwah ππ¦π
π¦ where this page comes from
- ubuntu resolute: acheck-rules 0.3.7 Β· GPL-2.0-or-later
- ubuntu stonking: acheck-rules 0.3.7 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms