hi,<br><br><div><bzr help rules> wrote: <br>
</div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">Rules are defined in ini file format where the sections are file glob<br>patterns and the contents of each section are the preferences for files<br>
matching that pattern. For example:<br><br> [name *.bat]<br> eol = dos<br><br> [name *.html]<br> keywords = escape</blockquote><br>I've always suspected but finally decided that I NEED rules to properly <br>
configure my text checker plugin.<br>here is an example of what I'd like to configure:<br>==<br>[name *.py, *.java, NEWS, README]<br>trailing_whitespace=fail<br>leading_tabs=warn<br>newline_at_eof=warn<br>long_line_length=80<br>
long_lines=ask<br>==<br><br>As you can see I'd like to specify the same bunch of rules for multiple globs.<br><br>I was thinking that we could split them up in rules.IniBasedRulesSearcher.__init__, <br>but then we'd have to <br>
(1) keep a dict of pattern->rules entries for when we match rules.<br>I figured that the config is read into memory anyways, so it wouldn't be that bad<br>to get what we need all at once and keep it. OR <br>(2) we just need to keep a dict of glob->section mappings.<br>
Would one of those be ok?<br><br>Also I think it would be handy to have a command to print out all the rules affecting<br>a specific branch or file eg:<br>bzr rules<br>[name *.bat]<br>eol = dos<br>...<br><br>bzr rules x.bat<br>
eol = dos<br>
<br>But then we'd have to rename the rules help topic.<br><br>regards<br>marius<br>