Skip to content

Commit 7aeb20e

Browse files
committed
Fixes in response to review.
1 parent 2086389 commit 7aeb20e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

ruleset-style.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Ruleset style guide
1+
# Ruleset Style Guide
22

3-
Goal: Rules should be written in a way that is consistent, easy for humans to
4-
read and debug, and reduces the chance of errors, and makes testing easy.
3+
Goal: rules should be written in a way that is consistent, easy for humans to
4+
read and debug, reduces the chance of errors, and makes testing easy.
55

66
To that end, here are some style guidelines for writing or modifying rulesets.
77
They are intended to help and simplify in places where choices are ambiguous,
@@ -26,7 +26,9 @@ http://www.wolframalpha.com/input/?i=_YOUR_DOMAIN_GOES_HERE_.
2626
If there are a handful of tricky subdomains, but most subdomains can handle the
2727
plain rewrite from "^http:" to "^https:", specify the rules for the tricky
2828
subdomains first, and then then plain rule last. Earlier rules will take
29-
precedence, and processing stops at the first matching rule.
29+
precedence, and processing stops at the first matching rule. There may be a tiny
30+
performance hit for processing exception cases earlier in the ruleset and the
31+
common case last, but in most cases the performance issue is trumped by readability.
3032

3133
Avoid regexes with long strings of subdomains, e.g. <rule
3234
from="^http://(foo|bar|baz|bananas).example.com" />. These are hard to read and

0 commit comments

Comments
 (0)