style-check 0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 57909f6c2ab0395b36cad6eaedd9e56c1fdd154a
4
+ data.tar.gz: 4f35cfb381ccd3e76681d57cf9270826b7787c06
5
+ SHA512:
6
+ metadata.gz: 08802afdea2e3d15c8cb9b2aa2dc7b6514a063ae112fae90f00da8f4bc5b0d45e0c249843d5c328d10f3fda6194fe895f62b7e14dd2e6e48626d563fabd67b0b
7
+ data.tar.gz: a1422e3b139d6d7b8a451bc0fd0b8147b42f1d43fd943f55d1e88adf6c84c534035103fc4809e5f00276f712a529b2b6dfb3adf310826ab376aebd47fbb5c5e7
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # this perhaps compounds the error a poor contant-filled
4
+ # design, but by moving *all* the code to the gem/lib
5
+ # location, the code can find the rules installed with the
6
+ # gem.
7
+
8
+ # it just feels so windows-dll like to do this.
9
+
10
+ require 'style-check'
11
+
@@ -0,0 +1,21 @@
1
+ utilize % phrase "use" http://www.bartleby.com/64/C003/0294.html
2
+ utilizes % phrase "uses" http://www.bartleby.com/64/C003/0294.html
3
+ leverage % phrase "use"
4
+ abstraction % phrase this is often used poorly?
5
+ fashion % phrase hrm.
6
+ [dw]on't % spelling do not or will not.
7
+ behavioral % spelling I'm convinced we don't use this word properly.
8
+ we'll % spelling we will
9
+ we've % spelling we have
10
+ [^r][^c][^h] impact % phrase "consequences", "effect", "result", though nsf likes "research impact"
11
+ tackle % phrase "tackle" (a problem) is wimpy for "solve" or a tired metaphor for "address a challenge".
12
+ thusly % phrase "thus" or "this way" or "like this" http://www.bartleby.com/64/C003/0282.html
13
+ transpire % phrase "happen"
14
+ so-called % phrase can be abused; it's negative.
15
+ necessitate % phrase require.
16
+ necessitated % phrase required.
17
+ necessitates % phrase requires.
18
+ loosing % spelling you almost certainly mean "losing". use "loosening" otherwise.
19
+ aforementioned % phrase too pretentious.
20
+ important to % phrase "valued by"?
21
+ notion % phrase avoid this weak phrase. (thanks brian bershad!)
data/lib/rules/barrass ADDED
@@ -0,0 +1,60 @@
1
+ ## I like this once in a while, for "goals" accomplish % phrase do
2
+ ## A nice hint, but not a good rule. additional % phrase extra, more
3
+ anticipate % phrase expect
4
+ breakthrough % phrase discovery
5
+ commence % phrase begin
6
+ conjecture % phrase guess
7
+ ## I use this correctly. consider % phrase think
8
+ considerable % phrase much
9
+ ## I often use this in a technical sense. construct % phrase build
10
+ demonstrate % phrase show
11
+ encounter % phrase meet
12
+ endeavour % phrase try
13
+ excepting % phrase except
14
+ exhibit % phrase show
15
+ fabriacate % phrase build
16
+ firstly % phrase first
17
+ guidelines % phrase guidance
18
+ hypothesize % phrase suggest
19
+ indication % phrase sign
20
+ initiate % phrase start
21
+ modification % phrase change
22
+ possess % phrase have
23
+ preventative % phrase preventive
24
+ ## often I use illustrations represents % phrase is
25
+ shortly % phrase soon (though best to say when)
26
+ subsequently % phrase later
27
+ # sufficient % phrase enough -- I often use sufficient technically.
28
+ ## I don't believe in this. upon % phrase on
29
+ utilisation % phrase use
30
+ ## I don't believe in this. within % phrase in
31
+ virtually % phrase almost
32
+ currently % phrase now
33
+ absolutely essential % phrase essential
34
+ an actual investigation % phrase an investigation
35
+ almost unique % phrase rare
36
+ completely surrounded % phrase surrounded
37
+ conclusive proof % phrase proof
38
+ an essential condition % phrase a condition
39
+ hard evidence % phrase evidence
40
+ they are in fact % phrase they are
41
+ few in number % phrase few
42
+ a positive identification % phrase an identification
43
+ quite obvious % phrase obvious
44
+ real problems % phrase problems
45
+ streamlined in appearance % phrase streamlined
46
+ quite unique % phrase unique
47
+ every individual one % phrase every one
48
+ the reason for this is because % phrase because
49
+ reason why % phrase reason -awu
50
+ reverted back % phrase reverted
51
+ related to each other % phrase related
52
+ each individual person % phrase each person
53
+ in actual fact % phrase in fact
54
+ a specific example % phrase an example
55
+ an integral part % phrase a part
56
+ different varieties % phrase varieties
57
+ grouped together % phrase grouped
58
+ percolate down % phrase percolate
59
+ eradicate completely % phrase eradicate
60
+ give positive encouragement % phrase encourage
data/lib/rules/cliche ADDED
@@ -0,0 +1,5 @@
1
+ dig deeper % phrase cliche
2
+ attack these problems % phrase bobby dislikes
3
+ crack these problems % phrase bobby dislikes
4
+ attack this problem % phrase bobby dislikes
5
+ crack this problem % phrase bobby dislikes
@@ -0,0 +1,58 @@
1
+ a the % phrase double article
2
+ pt % syntax ? I guess avoid straggling pt's that escape tex?
3
+ [ ], % syntax whitespace before comma seems wrong.
4
+ ''[\.,] % syntax end quotes go outside punctuation like . and ,
5
+ Figure Figure % phrase pizza pizza.
6
+ [ ]-[ ] % syntax a hyphen surrounded by space should probably be an emdash '---'
7
+ [0-9]-[0-9] % syntax use an endash '--' for ranges
8
+ [0-9]ms % syntax put a space between the number and the unit.
9
+ [^egs]\. [a-z] % syntax a period usually ends a sentence, and sentences should start with a capital; doesn't apply for i.e.,
10
+ \. [a-z] % syntax a period usually ends a sentence, and sentences should start with a capital; "i.e." should have a comma following.
11
+ [a-z]\.\. % syntax double period is rarely right, use \ldots for ellipsis
12
+ [^\\]" % syntax use fancy quotes
13
+ \beg\. % syntax should be e.g. as in "examples given"
14
+ from to\b % phrase haven't used this properly.
15
+ help help % phrase double word, that probably means the author paniced
16
+ of of % phrase apparent double word.
17
+ the affect % phrase should probably be 'the effect'
18
+ the the % phrase apparent double word.
19
+ there too few % phrase there are too few?
20
+ was not was % phrase pretty much a joke if this gets matched.
21
+ we we % phrase it would be oi oi in french, I guess.
22
+ with on % phrase probably wrong.
23
+ with with % phrase apparent double word.
24
+ [\n ]--[\n ] % syntax that's an en-dash, you want an em-dash: "---"
25
+ my my % phrase unlikely that's what you want, at least without a comma. (doesn't work across newlines)
26
+ >From % syntax be careful when you email .tex files. I've seen this slip through into submissions.
27
+ e\.t\.c\. % syntax it's et cetera; use etc.
28
+ such as like % phrase pick one
29
+ <<<<<<< . % syntax CVS conflict!
30
+ ======= % syntax CVS conflict!
31
+ >>>>>>> [0-9] % syntax CVS conflict!
32
+ [;:]'' % syntax close quotes before (semi-)colons, but after commas and periods
33
+ e\.g\.[\n ] % syntax should be followed with a comma, as e.g. can be read as "for example" (thanks JZ!)
34
+ i\.e\.[\n ] % syntax should be followed with a comma, as i.e. can be read as "that is" (thanks JZ!)
35
+ [ ]\.[\n ] % syntax stray period?
36
+ further more % phrase one word: furthermore
37
+ safe guard % phrase one word: safeguard
38
+ that be % phrase mistake.
39
+ can not % phrase cannot
40
+ only only % phrase double word
41
+ is is % phrase double word.
42
+ they shows % phrase argh, mistake.
43
+ less that than % phrase typo damage
44
+ from from % phrase double word score
45
+ in in % phrase "in" (common mistake)
46
+ not not % phrase argh.
47
+ it it % phrase argh.
48
+ to illicit % phrase "to elicit" -- illicit is always an adjective.
49
+ c\.f\. % phrase actually, it's cf., and you'd like cf.\ (backslash space)
50
+ this lead to % phrase "led to" if past tense, "leads to" if present.
51
+ on on % phrase double word.
52
+ has is % phrase choose
53
+ description their % phrase saw this, clearly wrong.
54
+ including: % syntax I prefer no colon after including, which already says a list is coming.
55
+ [a-z]\([A-Z] % syntax put a space before parens, even when introducing acronyms.
56
+ without and without % phrase saw this.
57
+ can be result % phrase saw this typo.
58
+
@@ -0,0 +1,214 @@
1
+ a considerable amount of % phrase "much"
2
+ a considerable number of % phrase "many"
3
+ a decreased amount of % phrase "less"
4
+ a decreased number of % phrase "fewer"
5
+ a great deal of % phrase "much"
6
+ a majority of % phrase "most", though 'a majority of' implies more than 50% while most implies significantly more.
7
+ a number of % phrase "many" or "some"
8
+ a situation in which % phrase "when"
9
+ a small number of % phrase "a few"
10
+ absolutely essential % phrase "essential"
11
+ accounted for by the fact % phrase "because"
12
+ adjacent to % phrase "near" or "next to"
13
+ along the lines of % phrase "like"
14
+ an adequate amount of % phrase "enough"
15
+ an example of this is the fact that % phrase "for example"
16
+ an order of magnitude faster % phrase "10 times as fast"
17
+ apprise % phrase "inform"
18
+ are of the same opinion % phrase "agree"
19
+ as a consequence of % phrase "because"
20
+ as a matter of fact % phrase "in fact" or leave out
21
+ as a result of % phrase "because"
22
+ as is the case % phrase "as happens"
23
+ as of this date % phrase "today"
24
+ as to % phrase "about" or leave out
25
+ at a rapid rate % phrase "rapidly" or "fast"
26
+ at an earlier date % phrase "soon"
27
+ at no time % phrase "never"
28
+ at present % phrase "now"
29
+ at some future time % phrase "later" or "sometime"
30
+ at the conclusion of % phrase "after"
31
+ at the present time % phrase "now"
32
+ at this point in time % phrase "now"
33
+ based on the fact that % phrase "because"
34
+ because of the fact that % phrase "because"
35
+ by means of % phrase "by" or "with
36
+ causal factor % phrase "cause"
37
+ cognizant of % phrase "aware of"
38
+ completely full % phrase "full"
39
+ consensus of opinion % phrase "consensus"
40
+ considerable amount of % phrase "much"
41
+ contingent upon % phrase "dependent on"
42
+ count the number of % phrase "count"
43
+ definitely proved % phrase "proved"
44
+ despite the fact that % phrase "although"
45
+ due to the fact that % phrase "because"
46
+ during the course of % phrase "during" or "while"
47
+ during the time that % phrase "while"
48
+ effectuate % phrase "cause"
49
+ elucidate % phrase "explain"
50
+ employ % phrase "use"
51
+ enclosed herewith % phrase "enclosed"
52
+ end result % phrase "result"
53
+ endeavor % phrase "try"
54
+ entirely eliminate % phrase "eliminate"
55
+ eventuate % phrase "happen"
56
+ fabricate % phrase "make"
57
+ facilitate % phrase "help"
58
+ fatal outcome % phrase "death"
59
+ fellow colleague % phrase "colleague"
60
+ fewer in number % phrase "fewer"
61
+ finalize % phrase "end"
62
+ first of all % phrase "first"
63
+ for the purpose of % phrase "for"
64
+ for the reason that % phrase "because"
65
+ from the point of view of % phrase "for"
66
+ future plans % phrase "plans"
67
+ give an account of % phrase "describe"
68
+ give rise to % phrase "cause"
69
+ has been engaged in a study of % phrase "has studied"
70
+ has the capability of % phrase "can"
71
+ has the potential to % phrase "can" or "may"
72
+ have the appearance of % phrase "look like" or "resemble"
73
+ having regard to % phrase "about"
74
+ immune serum % phrase "antiserum"
75
+ important essentials % phrase "essentials"
76
+ in a number of cases % phrase "sometimes"
77
+ in a position to % phrase "able to"
78
+ in a satisfactory manner % phrase "satisfactorily"
79
+ in a situation in which % phrase "when"
80
+ in a very real sense % phrase "in a sense" or leave out
81
+ in almost all instances % phrase "nearly always"
82
+ in case % phrase "if"
83
+ in close proximity to % phrase "close" or "near"
84
+ in connection with % phrase "about" or "concerning"
85
+ in light of the fact that % phrase "because"
86
+ in many cases % phrase "often"
87
+ in most cases % phrase "usually"
88
+ in my opinion it is not an unjustifiable assumption that % phrase "I think"
89
+ in only a small number of cases % phrase "rarely"
90
+ in order to % phrase "to"
91
+ in relation to % phrase "toward" or "to"
92
+ in respect to % phrase "about"
93
+ in some cases % phrase "sometimes"
94
+ in terms of % phrase "about"
95
+ in the absence of % phrase "without"
96
+ in the event that % phrase "if"
97
+ in the most effective manner % phrase "most effectively"
98
+ in the not too distant future % phrase "soon"
99
+ in the not-too-distant future % phrase "soon"
100
+ in the possession of % phrase "has" or "have"
101
+ in this day and age % phrase "today"
102
+ in view of the fact that % phrase "because"
103
+ inasmuch as % phrase "for" or "as"
104
+ in as much as % phrase "for" or "as"
105
+ incline to the view % phrase "think"
106
+ inclined to the view % phrase "thought"
107
+ initiate % phrase "begin" or "start"
108
+ is defined as % phrase "is"
109
+ is desirous of % phrase "wants"
110
+ is detrimental to % phrase "harms"
111
+ is similar to % phrase "resembles"
112
+ it has been reported by % phrase "___ reported"
113
+ it has long been known that % phrase "I haven't looked up the reference"
114
+ it is apparent that % phrase "apparently" or "clearly"
115
+ it is believed that % phrase "I think" (or say who thinks)
116
+ it is clear that % phrase "clearly"
117
+ it is clear that much additional work will be required % phrase "I don't understand it"
118
+ it is evident that % phrase probably not needed just say what happened
119
+ it is generally believed % phrase "many think"
120
+ it is my understanding that % phrase "I understand that"
121
+ it is of interest to note that % phrase leave out
122
+ it is often the case that % phrase "often"
123
+ it is suggested that % phrase "I think"
124
+ it is worth pointing out in this context % phrase omit
125
+ it may be that % phrase "I think" or "perhaps"
126
+ it may, however, be noted that % phrase "but"
127
+ it should be noted that % phrase omit
128
+ it was observed in the course of the experiments that % phrase "we observed"
129
+ join together % phrase "join"
130
+ lacked the ability to % phrase "could not"
131
+ large in size % phrase "large"
132
+ let me make one thing perfectly clear % phrase A snow job is coming...
133
+ majority of % phrase "most"
134
+ make reference to % phrase "refer to"
135
+ militate against % phrase "prohibit"
136
+ more often than not % phrase "usually"
137
+ needless to say % phrase (leave out, and consider leaving out what follows it)
138
+ new initiatives % phrase "initiatives"
139
+ no later than % phrase "by"
140
+ of an efficient nature % phrase "efficient"
141
+ of great theoretical and practical importance % phrase "useful"
142
+ of long standing % phrase "old"
143
+ of the opinion that % phrase "think that"
144
+ on a daily basis % phrase "daily"
145
+ on account of % phrase "because"
146
+ on behalf of % phrase "for"
147
+ on no occasion % phrase "never"
148
+ on the basis of % phrase "by"
149
+ on the grounds that % phrase "because"
150
+ on the part of % phrase "by" or "among" or "for"
151
+ on those occasions in which % phrase "when"
152
+ our attention has been called to the fact that % phrase "we belatedly discovered"
153
+ owing to the fact that % phrase "because"
154
+ perform % phrase "do"
155
+ place a major emphasis on % phrase "stress" or "emphasize"
156
+ pooled together % phrase "pooled"
157
+ presents a picture similar to % phrase "resembles"
158
+ previous to % phrase "before"
159
+ prior to % phrase "before"
160
+ determinations were performed % phrase "were determined"
161
+ quantify % phrase "measure"
162
+ quite a large quantity of % phrase "much"
163
+ quite unique % phrase "unique"
164
+ rather interesting % phrase "interesting'
165
+ red in color % phrase "red"
166
+ referred to as % phrase "called"
167
+ regardless of the fact that % phrase "even though"
168
+ relative to % phrase "about"
169
+ resultant effect % phrase "result"
170
+ root cause % phrase "cause"
171
+ serious crisis % phrase "crisis"
172
+ should prove the case that % phrase "if"
173
+ smaller in size % phrase "smaller"
174
+ so as to % phrase "to"
175
+ subject matter % phrase "subject"
176
+ subsequent to % phrase "after"
177
+ sufficient % phrase "enough"
178
+ take into consideration % phrase "consider"
179
+ terminate % phrase "end"
180
+ the fact of the matter is that % phrase (leave out)
181
+ the field of % phrase just say the field name "chemistry"
182
+ the great majority of % phrase "most" or "almost all"
183
+ the opinion is advanced that % phrase "I think"
184
+ the predominate number of % phrase "most"
185
+ the question as to whether % phrase "whether"
186
+ the reason is because % phrase "because"
187
+ the vast majority of % phrase "most" or "almost all"
188
+ there is a reason to believe % phrase "I think"
189
+ they are the investigators % phrase "they"
190
+ this result would seem to indicate % phrase "the result indicates"
191
+ results seem to indicate % phrase "the results indicate"
192
+ result seems to indicate % phrase "the result indicates"
193
+ through the use of % phrase "by" or "with"
194
+ to the fullest possible extent % phrase "fully"
195
+ transpire % phrase "happen"
196
+ ultimate % phrase "last"
197
+ unanimity of opinion % phrase "agreement"
198
+ until such time % phrase "until"
199
+ utilization % phrase "use"
200
+ utilize % phrase "use"
201
+ very unique % phrase "unique"
202
+ was of the opinion % phrase "believed"
203
+ ways and means % phrase "ways" or "means" but not both
204
+ we have insufficient knowledge % phrase "we do not know"
205
+ we wish to thank % phrase "we thank"
206
+ what is the explanation of % phrase "why"
207
+ whether or not to % phrase "whether to"
208
+ with a view to % phrase "to"
209
+ with reference to % phrase "about" (or leave out)
210
+ with regard to % phrase "concerning" or "about" (or leave out)
211
+ with respect to % phrase "about
212
+ with the exception of % phrase "except"
213
+ with the result that % phrase "so that"
214
+ within the realm of possibility % phrase "possible"
@@ -0,0 +1,18 @@
1
+ (quite|more|very|most) unique % phrase unique is.
2
+ (quite|more|very|most) abstract % phrase abstract is.
3
+ tangible view % phrase mix that metaphor some more.
4
+ for e\.g\. % phrase e.g. includes "for".
5
+ begs the question % phrase unless you're very clever: "raises the question": http://alt-usage-english.org/excerpts/fxbegthe.html
6
+ high rate of speed % phrase local news-speak.
7
+ especially necessary % phrase 'especially important', necessary may be an absolute like unique.
8
+ how will it effect % phrase you likely meant "affect"
9
+ how it will effect % phrase you likely meant "affect"
10
+ insure proper performance % phrase "ensure"
11
+ especially true % phrase 'especially important', true may be an absolute like unique.
12
+ to affect change % phrase "effect" change; I read this on a poster.
13
+ higher results % phrase maybe higher performance or higher values.
14
+ is more general then the % phrase probably "than"
15
+ upper bounding % phrase "limiting" or "setting an upper bound on"
16
+ in principal % phrase likely, "in principle"
17
+ literally like % phrase literally means no simile.
18
+ design principal % phrase likely, "design principle"
@@ -0,0 +1,27 @@
1
+ \{\\em [^\}]*[^\}\/]\}[:] % syntax use \emph{} or explicit italic correction {\em foo\/}
2
+ \{\\em [^\}]*[:\.,]\} % syntax punctuation at the edges of italic text is not italicized
3
+ [A-Z]{2,10}\.[ ]*[\n ][ ]*[A-Z] % syntax intersentence spacing should be used if a sentence ends with an acronym: "FOO\\@."
4
+ \\etal[^{] % syntax it's good practice to use \etal{} to avoid bad spacing
5
+ \\caption\[[^\]]*[^\.]\] % syntax short caption should end with a period.
6
+ \\caption\[.*CCDF.*\] % syntax short caption should not include graph type.
7
+ \\caption\[.*CDF.*\] % syntax short caption should not include graph type.
8
+ \\caption\[.{0,25}\] % syntax short caption should not be too short.
9
+ [ ]---[ ] % syntax the em-dash should be right up against the words.
10
+ [ \n]---[ \n] % syntax the em-dash should be right up against the words.
11
+ ^---[ \n] % syntax the em-dash should be right up against the words.
12
+ [ \n]---$ % syntax the em-dash should be right up against the words.
13
+ [ \n]--[ \n] % syntax the en-dash should be between numbers.
14
+ ^--[ \n] % syntax the en-dash should be between numbers.
15
+ [ \n]--$ % syntax the en-dash should be rbetween numbers.
16
+ ,[~ ]\\etal % syntax no comma before etal (unless Smith, Martinez, \etal)
17
+ \\etal\{\}'s % syntax eew.
18
+ \\(sub)?section\{[A-Z][^}]*[ ][a-z]{5,40}[^}]*\} % syntax subsection headers should be initial capped.
19
+ \\(sub)?section\{[A-Z][^}]*[^:][ ]{1,}(With|A|An|Is|And|For|To|The)[ ][^}]*\} % syntax some words needn't be capitalized
20
+ [ ]\\footnote % syntax no space before footnote.
21
+ ,, % syntax double comma is unlikely to be intentional.
22
+ cf\.[^\\] % phrase cf. should get an escaped space "\ "
23
+ [a-z]''[\.] % syntax close quotes outside the period. (doesn't seem to work.)
24
+ [<>] % syntax a less than or greater than outside math mode shows other characters.
25
+ in section \\ref % phrase should have ~ between section and ref
26
+ section~\\ref % capitalize capitalize section when saying Section 6.
27
+ \\(sub)?section\{Intro\} % syntax spell it out.
@@ -0,0 +1,33 @@
1
+ asess % spelling
2
+ elimintate % spelling
3
+ enginner % spelling
4
+ experiements % spelling
5
+ measurment % spelling
6
+ pathlogies % spelling
7
+ secrurity % spelling
8
+ taht % spelling
9
+ teh % spelling
10
+ thrid % spelling
11
+ accrurate % spelling
12
+ prevalance % spelling prevalence
13
+ upto % spelling not a word, should be "up to"
14
+ til % spelling not a word, should be "until"
15
+ thes % spelling indecisive these/the
16
+ accurarte % spelling
17
+ suppots % spelling
18
+ privledge % spelling "privilege" I misspell it every way possible.
19
+ privlege % spelling "privilege" I misspell it every way possible.
20
+ priviledge % spelling "privilege" I misspell it every way possible.
21
+ infomation % spelling
22
+ queueing % spelling I'd love to spell it this way, but spellchecker whines.
23
+ vatnage % spelling argh.
24
+ hte % spelling
25
+ acknowledgement % spelling acknowledgment, though what you have is technically legal, despite ispell.
26
+ acknowlegement % spelling needs a d.
27
+ acknowlegment % spelling needs a d.
28
+ acknowledgements % spelling acknowledgment , though what you have is technically legal, despite ispell.
29
+ acknowlegements % spelling needs a d.
30
+ acknowlegments % spelling needs a d.
31
+ targetted % spelling "targeted"
32
+ desireable % spelling "desirable"
33
+ fullproof % spelling found this in savage et al. traceback
@@ -0,0 +1,60 @@
1
+ # such may be abused to blacklist certain words even spelled correctly.
2
+ # capitalize is case sensitive, and also bracketed by non-word.
3
+ # phrase and spelling are case insensitive, but bracketed by non-word characters.
4
+ # syntax is case sensitive but not bracketed by non-word; probably best if used with regexes.
5
+ \bet al\.[^}] % syntax use the \etal{} command instead. (or write one to italicize)
6
+ \bet\. al\. % syntax use the \etal{} command, "et" needs no dot (et alii). (or write one to italicize)
7
+ \bc\.f\.\b % syntax should be cf. for "confer" (latin for compare)
8
+ \b$i\)[^$] % syntax leave the paren in math mode -- should be $i)$
9
+ \b$ii\)[^$] % syntax leave the paren in math mode -- should be $ii)$
10
+ \b$iii\)[^$] % syntax leave the paren in math mode -- should be $iii)$
11
+ \b$iv\)[^$] % syntax leave the paren in math mode -- should be $iv)$
12
+ \b$v\)[^$] % syntax leave the paren in math mode -- should be $v)$
13
+ \ban [b-df-gj-np-tv-z] % syntax probably meant to use "a" instead of "an", though there are exceptions.
14
+ \ban [B-DF-GJ-NP-TV-Z][^A-Z/] % syntax probably meant to use "a" instead of "an", though there are exceptions (like acronyms).
15
+ \b[Aa] [aeiouAEIOU](?!se|ni|A|ur|RL|ti|ne|DP) % syntax probably meant to use "an" instead of "a", though there are exceptions. (user, useful, AA, unified, uniform, unique, Europe, one, UDP; n/a doesn't work, so use {n/a})
16
+ This allows % phrase tie more explicitly: This (x) allows...
17
+ try and % phrase "try to", though if you're using try as a noun in a compound sentence, this rule is wrong.
18
+ impact of % phrase not a useful metaphor; try evaluation, success, effect, value.
19
+ including [^\.]*etc\. % syntax "including" tells of a non-exclusive list, so "etc." is redundant. This rule will misfire if you have two lists in your sentence, but you shouldn't do that either. ;)
20
+ includes [^\.]*etc\. % syntax "includes" tells of a non-exclusive list, so "etc." is redundant. This rule will misfire if you have two lists in your sentence, but you shouldn't do that either. ;)
21
+ and etc\. % phrase come on. learn some latin.
22
+ AT&T % syntax you poor thing, this won't compile.
23
+ doesn't % phrase be formal.
24
+ be occur % phrase what happens when I'm indecisive about what follows "can"
25
+ up until % phrase "until"
26
+ one or more % phrase probably redundant -- nonzero is probably implied.
27
+ is comprise(d|s) of % phrase you probably mean "is composed of" because "comprises" is more a synonym for "contains"
28
+ will be significantly different % phrase "will differ significantly" for active voice
29
+ More importantly, % phrase probably means the order is wrong: put important stuff first.
30
+ todo % ignoredcommand
31
+ texttt % ignoredcommand
32
+ due to space constraints % phrase don't whine.
33
+ this paper % phrase can be ambiguous if talking about someone else's paper whether you mean the one youre writing or the one you're talking about..
34
+ the above % phrase horrible phrase that must be expunged. you might use "these" instead, but best to make the sentence stand alone.
35
+ referred to above % phrase "these".
36
+ (all|the|of) [0-9][ ] % phrase use words for numbers in phrases.
37
+ clearly shows % phrase "clearly" is usually much.
38
+ grows larger % phrase is "grows smaller" possible? grows.
39
+ guarantee as much as possible % phrase then not really a guarantee "provide"
40
+ affects negatively % phrase "hurts" or "harms"
41
+ rely upon % phrase rely on is good enough
42
+ relies upon % phrase relies on is good enough
43
+ record route packets? % phrase hyphenate record-route packets
44
+ record-route; % phrase leave record route alone if not modifying something else
45
+ we accomplish this % phrase verbose way to get active voice.
46
+ refers to the % phrase you're being wimpy in the definition. use "is"
47
+ \\emph\{[a-zA-Z ]*\} refers to % syntax you're being wimpy in the definition.
48
+ loss off % phrase loss of?
49
+ this could % phrase this "what" could
50
+ with that has % phrase probably just one
51
+ simply % phrase probably isn't.
52
+ to get to % phrase "to reach"?
53
+ latency benefit % phrase reduction
54
+ latency improvement % phrase reduction
55
+ shed insight % phrase 'shed light' would seem the metaphor.
56
+ increasingly more % phrase redundant
57
+ I\.e\. % syntax starting a sentence with i.e. is just ugly.
58
+ E\.g\. % syntax starting a sentence with e.g. is just ugly.
59
+ in the large % phrase if large is a noun, bad. if it's an adjective, fine.
60
+ encapsulates with % phrase seen it, don't know what it means.
@@ -0,0 +1,50 @@
1
+ EBONE % capitalize a somewhat useless rule, now (we standardized on Ebone)
2
+ EBone % capitalize a somewhat useless rule, now (we standardized on Ebone)
3
+ IPs % phrase should be IP addresses
4
+ NMI % spelling is Steve's cat's name, not a measurement system
5
+ Planetlab % capitalize PlanetLab
6
+ Send-Train % capitalize should be Send-train
7
+ UUNET % capitalize UUnet
8
+ [Rr]ate-limits % spelling "rate limits" has no hyphen, only "rate-limited"
9
+ [a-z] Tier % syntax don't capitalize Tier unless at the beginning of the sentence
10
+ ``no-valley'' % spelling should not be quoted, it's distracting
11
+ best effort % phrase hyphenate best-effort service.
12
+ bpf % capitalize
13
+ ccdf % capitalize
14
+ cisco % capitalize the company name
15
+ city-pairs % phrase decided to hyphenate
16
+ deliver route % phrase jargon redundancy
17
+ euclidean % capitalize Euclidean.
18
+ interdomain % spelling inter-domain
19
+ internet % capitalize unless talking about an internet other than the Internet
20
+ intradomain % spelling intra-domain
21
+ load\bbalanc % syntax load-balanced links, hyphenate load-balancing too
22
+ log-normal % spelling lognormal is one word.
23
+ magic-packet % spelling don't hyphenate
24
+ multiaccess % spelling multi-access (or better, multiple access)
25
+ namespace % spelling two words
26
+ nimi % capitalize
27
+ no\bvalley % phrase hyphenate no-valley
28
+ pareto % capitalize
29
+ planetlab % capitalize PlanetLab
30
+ points links % phrase probably wrong to have two plural nouns adjacent
31
+ scriptroute % capitalize
32
+ send-train % capitalize should be Send-train
33
+ tier [123] % phrase should be tier-1, tier-2, or tier-3.
34
+ tier-[123]s % phrase should be tier-1 ISPs
35
+ ttl % capitalize
36
+ weibull % capitalize proper name.
37
+ PoP % syntax I think POP looks less annoying.
38
+ PoPs % syntax I think POP looks less annoying.
39
+ the general Internet % phrase it's just the Internet. there is only one.
40
+ IP-ID % phrase spell it out
41
+ handful of routers % phrase they don't fit in your hand
42
+ outdegree % phrase going to use hyphenated form.
43
+ network measurement algorithms % phrase you're too kind to network measurement. I haven't seen an algorithm yet.
44
+ http[ ] % capitalize capitalize HTTP.
45
+ linux % capitalize capitalize Linux
46
+ Internet[^\.]*Internet % syntax avoid Internet twice in the same sentence?
47
+ zipf % capitalize capitalize the guy's name.
48
+ in network distance % phrase what is that?
49
+ TIMEWAIT % spelling it's "TIME-WAIT", hyphenated in rfc 793
50
+ FINWAIT % syntax it's "FIN-WAIT-1" or "FIN-WAIT-2", hyphenated in rfc 793
@@ -0,0 +1,19 @@
1
+ it is possible to % phrase passive voice, try: "can"
2
+ are identified by % phrase passive
3
+ is shown % phrase passive.
4
+ is not included in % phrase maybe this is passive
5
+ there (are|is) [^\.:;]* (that|in) % phrase maybe this is passive
6
+ can be evaluated % phrase avoid passive: I evaluated
7
+ can be observed % phrase avoid passive: are visible
8
+ # is needed % phrase passive voice
9
+ is used to % phrase go active voice, or subsititute "helps"
10
+ (are|were) needed[^\?] % phrase passive voice
11
+ (is|are) presented in % phrase "appears in", or reword to avoid passive voice
12
+ it is possible that % phrase "may"
13
+ (is|are) (depicted|illustrated|sketched) in % phrase thats passive voice
14
+ (is|are) shown in % phrase "shows"
15
+ as can be seen in % phrase X shows that Y.
16
+ there needs to be % phrase passive voice in a bad way.
17
+ was designed % phrase passive voce.
18
+ it may be % phrase passive "it"
19
+ it is important that % phrase passive; replace with X is important because Y.
@@ -0,0 +1,229 @@
1
+ a large number of % phrase you mean "many"
2
+ a substantial number of % phrase how substantial? most? or just enough that can't be ignored?
3
+ an insufficient number of % phrase "too few"
4
+ a significant number of % phrase one is significant. consider "prohibitive" if the number is sufficient to be problematic.
5
+ a number of % phrase getting the verb agreement for this useless phrase is tricky.
6
+ a number of different % phrase use "different" (should have a high score)
7
+ a small number of % phrase you mean "few"
8
+ a low number of % phrase you mean "few"
9
+ a relatively low number of % phrase you mean "few"
10
+ actually % spelling probably doesn't add
11
+ and instead % phrase replace with but?
12
+ be done % phrase if "X of Y can be done", try "Y can be Xed"; it's already passive voice.
13
+ combining multiple % phrase as opposed to "combining one?"
14
+ aggregating multiple % phrase "aggregating"
15
+ do this % phrase probably verbose if you use a pronoun for what you're doing
16
+ exists[ ] % phrase probably no better than "is", but end of sentence may be unavoidable?
17
+ if it is to % phrase should be "to" (usually followed by "be X")
18
+ if they are to % phrase should be "to" (usually followed by "be X")
19
+ in general % phrase unless matched with "in specific," this is usually useless; perhaps "overall"
20
+ in order to % phrase remove "in order" and get "to"
21
+ in the past % phrase past tense is likely enough.
22
+ in the way of % phrase should be "as"
23
+ counting the number of % phrase counting. dude.
24
+ is permitted to % phrase "may"
25
+ largely opaque % phrase largely does not modify opaque
26
+ makes a new % phrase should be "creates"
27
+ may not chose % phrase "may not" is future tense; "chose" is past.
28
+ one should note % phrase just write it.
29
+ note that % phrase is the rest of the paper less notable?
30
+ Note, that % syntax not only should you not "note that", no comma after note.
31
+ we note % phrase is the rest of the paper less notable?
32
+ note however that % phrase is the rest of the paper less notable?
33
+ it is important to note % phrase is the rest of the paper less notable?
34
+ really % phrase probably doesn't add; if you think it does, use "r{}eally" -- don't change to 'in fact'
35
+ rigorously % spelling probably doesn't add, and I rarely do anything with rigor
36
+ the way in which % phrase should be "how" or ""
37
+ the manner in which % phrase should be "how" or ""
38
+ value stems % phrase value is derived or offered, I think.
39
+ time at which % phrase very likely "when"
40
+ place at which % phrase very likely "where"
41
+ at the time % phrase very likely "when"
42
+ reduced number of % phrase very likely "fewer" or maybe maybe "less"
43
+ is present in % phrase present is probably redudant, try "is in"
44
+ they all % phrase maybe "all xs" would be better.
45
+ easy to do % phrase "feasible" or "practical" might be better.
46
+ is going to % phrase "will".
47
+ are going to % phrase "will".
48
+ getting % phrase probably "receiving" or "querying"
49
+ those are % phrase see if "those X are" is clearer?
50
+ design is motivated % phrase "inspired by" is probably better than "motivated" for design
51
+ locations throughout the world % phrase drop "throughout the world"
52
+ e.g., as opposed to % phrase if you're giving examples, you're not talking about what isn't. drop "e.g."
53
+ in addition, we also % phrase remove either "also" or "in addition"
54
+ other related issues % phrase probably remove "other"
55
+ the aforementioned % phrase "these xs" or "this x" would be less snooty
56
+ center around % phrase (cook) a center is a point: "center on" is okay.
57
+ could care less % phrase (cook) 'really? how much less could you care?' (should be couldn't)
58
+ grouped together % phrase redundant. "grouped" alone should suffice.
59
+ put together % phrase long: "construct" "build" or "assemble"
60
+ consistent with each other % phrase redundant. "consistent" suffices.
61
+ be accomplished with % phrase try "requires" "uses" "needs"?
62
+ the lack of knowledge of % phrase would "X is unknown" work better?
63
+ gets to know % phrase you mean "learns"
64
+ trying to look like % phrase you mean "acting", "emulating", or "mimicing"
65
+ has got to be % phrase "must be"
66
+ got % phrase try "became" "received" ?
67
+ gotten % phrase try "helped" ?
68
+ live in a vacuum % phrase a tired metaphor that makes me want to vomit.
69
+ positive impact % phrase try "benefit"
70
+ negative impact % phrase try "harm" or "consequences"
71
+ adverse impact % phrase try "harm" or "consequences"
72
+ adversely impacting % phrase try "harming" or "hurting"
73
+ discuss the issues of % phrase could probably drop "the issues of" unless there's a list
74
+ the presence of % phrase not far from 'is', 'has', etc.
75
+ does not allow % phrase consider "forbids" or "prohibits"
76
+ and/or % phrase just say or.
77
+ there is the potential to % phrase just say may.
78
+ there is the possibility that % phrase just say might.
79
+ can be achieved % phrase maybe not so good?
80
+ find out % phrase perhaps determine?
81
+ in the absence of % phrase perhaps without?
82
+ in the presence of % phrase perhaps with?
83
+ set up % phrase perhaps create, configure, or initialize
84
+ in the face of % phrase can be overused. try despite?
85
+ several times (at|of) % phrase discouraged by Kurt.
86
+ a large degree of % phrase ick.
87
+ we start by first % phrase redundant. ("first, we" or "we start by").
88
+ in general, they are usually % phrase redundant.
89
+ refers to the notion % phrase define your term precisely if possible.
90
+ a significant amount of % phrase probably just "significant"
91
+ real practical % phrase as opposed to imaginary practical?
92
+ people that are % phrase use people who are?
93
+ additional detail that we add % phrase as opposed to additional detail that we subtract?
94
+ in some cases and not in others % phrase "in some cases"
95
+ it is known that % phrase just say it.
96
+ caused due to % phrase "caused by"
97
+ a result of the fact that % phrase "caused by"
98
+ can be attributed to the fact that % phrase "is because"
99
+ a large set of % phrase probably don't care that it is a set.
100
+ a small set of % phrase probably don't care that it is a set: use 'a few'
101
+ provides a look at % phrase (timid) probably mean "shows".
102
+ in most cases % phrase "usually"
103
+ continue into the forseeable future % phrase "continue".
104
+ for the forseeable future % phrase drop.
105
+ fail to successfully % phrase "fail to" is sufficient.
106
+ Clearly, % syntax starting a sentence with clearly confuses me.
107
+ in different continents % phrase ON different continents, IN different countries
108
+ (we|to) handle % phrase use a more specific verb like address, treat, solve
109
+ handling % phrase use a more specific verb like addressing, treating, solving, mitigating (unless handling errors or exceptions)
110
+ For the purposes of % phrase "For"
111
+ We observe that % phrase drop.
112
+ some degree of % phrase "some"
113
+ in the problem of % phrase (contributed by rap)
114
+ conclude several things % phrase make (draw) several conclusions
115
+ extra bonus % phrase "bonus"
116
+ added bonus % phrase "bonus"
117
+ it is important to emphasize that % phrase use diction to emphasize.
118
+ it is possible that % phrase "x may y"
119
+ caused due to % phrase "caused by"
120
+ recent work by % phrase could maybe be dropped, as the cite will include the date.
121
+ identify the location of % phrase "find"
122
+ that go across % phrase "that cross"
123
+ ideally, we would like % phrase "we would like"
124
+ enabling the ability to % phrase "supporting" or "allowing" or "permitting"
125
+ absolutely essential % phrase essential is.
126
+ we essentially do % phrase essentially is a poor adverb. "The essence of our algorithm is a..."
127
+ Essentially, % phrase maybe "In essence," but could also be removed.
128
+ In this section (we|I) % phrase "In this section, we", or "In this section, I"
129
+ essentially all % phrase "most"
130
+ past experience % phrase "experience" http://www.cmu.edu/styleguide/trickywords.html
131
+ particulary difficult primarily % phrase simplify
132
+ intuition about why % phrase "intuition as to why"
133
+ Recall from above % phrase "recall"
134
+ Further, (I|we) will also % phrase drop further or also
135
+ respectively % phrase unneeded.
136
+ in terms of % phrase don't need this.
137
+ the extent to which % phrase "how much"
138
+ make sure % phrase "ensure"
139
+ make up % phrase "constitute" "compose"
140
+ make a decision % phrase "decide"
141
+ make a guess % phrase "guess"
142
+ since that time % phrase "since then"
143
+ choices to make % phrase "choices"
144
+ certain limitations % phrase what does 'certain' add to limitations?
145
+ will [a-z]* in the future % phrase "will"
146
+ business entities % phrase "businesses"
147
+ rely primarily on % phrase "primarily" weakens "rely". perhaps just "use" would be simpler.
148
+ has the potential to % phrase can
149
+ have not yet developed % phrase "have yet to develop"
150
+ to be effective, % phrase probably redundant.
151
+ provide information about % phrase "tell how" "reveal" "expose" "disclose"
152
+ are different, % phrase "differ"
153
+ have already been % phrase "have been"? "were"?
154
+ as appropriate % phrase not needed?
155
+ only rarely % phrase "rarely" is probably enough.
156
+ is effective at % phrase "can"
157
+ foremost among them is % phrase "foremost is" would be shorter.
158
+ those that have no % phrase those without
159
+ that have no % phrase "without"?
160
+ a variety of diverse % phrase redundant
161
+ be highly valuable in % phrase simplify.
162
+ the overall goal % phrase 'the goal'
163
+ sometimes an? [a-z]+ will % phrase an x may
164
+ this is perhaps because % phrase this may be because
165
+ adding an additional % phrase redundant
166
+ IP protocol % phrase redundant
167
+ works well % phrase be more specific.
168
+ something % phrase could eliminate.
169
+ to keep from % phrase "to avoid"
170
+ [\.,] since (!then) % phrase probably you mean "because" unless you're talking about time. -- "has since" is okay.
171
+ performance characteristics % phrase rare that characteristics adds.
172
+ takes into account % phrase considers
173
+ specify particular % phrase if specifying, particular should be redundant.
174
+ prototype implementation % phrase "implementation" is redundant.
175
+ given a particular % phrase "given a" is probably enough
176
+ described in detail (in|below) % phrase use "detailed"
177
+ relatively more % phrase more is already relative.
178
+ focus primarily on % phrase bad metaphor: subject of focus is singular.
179
+ primary focus % phrase bad metaphor: subject of focus is singular.
180
+ relatively more % phrase more is already relative.
181
+ gives [a-z]+ [a-z]+ information about % phrase use "tells" x
182
+ gives [a-z]+ information about % phrase use "tells" x
183
+ an important question to ask is % phrase just ask it.
184
+ an interesting thing % phrase avoid saying something is interesting. if you have to say it, it isn't.
185
+ checks to see if % phrase "checks" or "determines"
186
+ have an effect on % phrase "affect"
187
+ an important question to ask is % phrase just ask it.
188
+ an interesting thing % phrase avoid saying something is interesting. if you have to say it, it isn't.
189
+ checks to see if % phrase "checks" or "determines"
190
+ we can see % phrase "we can see" isn't formal enough.
191
+ still remain % phrase "remain".
192
+ change over time % phrase "change"
193
+ turn into % phrase "become"
194
+ looking back in retrospect % phrase pick.
195
+ ensures that there will be no % phrase "prevents"
196
+ does have % phrase "has"
197
+ first step toward this % phrase "toward this" can probably be dropped.
198
+ can potentially be % phrase "might be", or just "can be"
199
+ obviates the need for % phrase just obviates x, not obviates the need for x.
200
+ it is indeed % phrase "it is", though still passive.
201
+ planning in advance % phrase when else might you plan?
202
+ a lot of % phrase "many"
203
+ keep in mind % phrase "consider" (or drop)
204
+ it is clear that % phrase if clear, you don't have to say it.
205
+ especially true % phrase true is an absolute, can't be especially true.
206
+ making it increasingly difficult % phrase preventing, discouraging, impeding, blocking, slowing...
207
+ is potentially % phrase "may be"
208
+ have been [a-z]* in the past % phrase 'in the past' is redundant with tense.
209
+ amount of time % phrase "duration"
210
+ should ideally % phrase "should"
211
+ are of great benefit to % phrase "help" or "aid"
212
+ are of benefit to % phrase "help" or "aid" or "promote"
213
+ important here % phrase consider "relevant"
214
+ while at the same time % phrase "while" is enough.
215
+ are able to % phrase can
216
+ subvert the proper operation of % phrase subvert
217
+ speed slow % phrase speed is probably redundant.
218
+ of size no smaller than % phrase "of size" is probably redundant
219
+ of size no larger than % phrase "of size" is probably redundant
220
+ of size smaller than % phrase "of size" is probably redundant
221
+ of size larger than % phrase "of size" is probably redundant
222
+ might potentially % phrase "might"
223
+ in the context of % phrase "in" avoid, if possible.
224
+ increase the amount of % phrase probably just increase.
225
+ show the difference between % phrase compare
226
+ in addition, we also % phrase pick.
227
+ overhead efficiency % phrase huh?
228
+ have an effect on % phrase "affect"
229
+ have a signficant effect on % phrase "affect"
@@ -0,0 +1,254 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # enough that the main code can find these rules.
4
+ Gem_Ruleset_Path = File.dirname(__FILE__) + "/rules"
5
+ test(?e, Gem_Ruleset_Path) or raise "gem installed incorrectly; rules directory not found"
6
+
7
+ Gem_Rulesets = Dir.glob(Gem_Ruleset_Path + "/*")
8
+
9
+ #!/usr/bin/env ruby
10
+
11
+ # copyright 2004 Neil Spring
12
+ # distributed under the terms of the GNU General Public License.
13
+
14
+ # a simple script to check against a ruleset of "forbidden"
15
+ # phrases and spellings. it is intended as a quick check
16
+ # against verbose phrases, overused expressions, incorrect
17
+ # spellings, and inconsistent capitalization or hypenation.
18
+
19
+ # complexity in this script arised from handling basic tex
20
+ # comments and ignoring fragments of tex that are allowed to
21
+ # violate style (such as the bibtex tag inside \cite{})
22
+
23
+ # the dictionary of censored phrases is a compound of
24
+ # ~/.style-censor, ./censor-dict (for historical reasons),
25
+ # and /etc/style-censor, as well as all files in
26
+ # ~/.style-check.d, for particularly egregious violations
27
+ # (such as spelling errors and common double-word problems).
28
+
29
+ # this script is not intended to substitute for a spell
30
+ # checker, a grammar checker, or a proof-reader. And the
31
+ # phrases listed aren't necessarily forbidden; they may
32
+ # simply be discouraged. Those that are particularly weak
33
+ # should be annotated with a question mark at the end of the
34
+ # explanation. (the behavior of the script does not currently
35
+ # depend on this syntax. someday it may.)
36
+
37
+ # Bugs
38
+
39
+ # - misspelled words may not be recognized if capitalized.
40
+ # This is a consequence of the script's goal of watching for
41
+ # uniform upper- and lower- case project names and such.
42
+
43
+ # - expressions with % in them won't be matched; the %
44
+ # character is reserved for explanatory text.
45
+
46
+ # if run with -g, insert a space between line and column,
47
+ # so that gedit linkparser.py at least parses the file and
48
+ # line number
49
+ Gedit_Mode = if(ARGV.include?("-g"))
50
+ ARGV.delete("-g")
51
+ true
52
+ else
53
+ false
54
+ end
55
+
56
+ if(ARGV[0] == "-v") then
57
+ ARGV.shift
58
+ $VERBOSE = true
59
+ end
60
+
61
+ override_rule_paths = nil
62
+ if(ARGV[0] == "-r") then
63
+ ARGV.shift
64
+ param = File.expand_path(ARGV.shift)
65
+ if(test(?d, param)) then
66
+ override_rule_paths = Dir.glob(param + "/*")
67
+ elsif(test(?f, param)) then
68
+ override_rule_paths = param
69
+ else
70
+ raise "what is that rule path you tried to specify?"
71
+ end
72
+ end
73
+
74
+ $exit_status = 0
75
+
76
+ ignoredCommands = "ref|href|url|input|bibliography|cite|nocite|cline|newcommand|includegraphics|begin|end|label".split('|')
77
+ PctCensored_phrases = Hash.new # before stripping comments
78
+ PreCensored_phrases = Hash.new # before stripping cites
79
+ Censored_phrases = Hash.new # the rest.
80
+ PathList = if(override_rule_paths) then
81
+ override_rule_paths
82
+ else
83
+ (Gem_Rulesets ? Gem_Rulesets : [] ) +
84
+ Dir.glob("/etc/style-check.d/*") +
85
+ Dir.glob(ENV["HOME"] + "/.style-check.d/*") +
86
+ [ ENV["HOME"] + "/.style-censor", "./censor-dict", "/etc/style-censor", "./style-censor" ]
87
+ end
88
+
89
+ # $prefilter = nil
90
+
91
+ PathList.map { |rulefilename|
92
+ if ( Kernel.test(?f, rulefilename) && rulefilename !~ /~$/ ) then
93
+ # $stderr.print "loading #{rulefilename}"
94
+ File.open(rulefilename).each_with_index { |phr,lnnum_minus_one|
95
+ #if ( ! phr.scan(~ /^# / ) then
96
+ expression, reason = phr.split(/\s*%\s*/)
97
+ if( reason ) then
98
+ begin
99
+ Censored_phrases[
100
+ case reason.split(/\s+/)[0]
101
+ when 'syntax'
102
+ Regexp.new(expression.chomp)
103
+ when 'capitalize'
104
+ Regexp.new('\b' + expression.chomp + '\b' )
105
+ when 'phrase'
106
+ # $stderr.puts('\b' + expression.chomp.gsub(/ +/, '\s+').gsub(/([a-zA-Z])$/, '\1\b'))
107
+ Regexp.new('\b' + expression.chomp.gsub(/ +/, '\s+').gsub(/([a-zA-Z\)])$/, '\1\b'), Regexp::IGNORECASE )
108
+ when 'spelling'
109
+ Regexp.new('\b' + expression.chomp + '\b', Regexp::IGNORECASE )
110
+ when 'ignoredcommand'
111
+ ignoredCommands.push(expression.chomp)
112
+ nil
113
+ else
114
+ puts "warning: no class specified for %s at %s:%d" % [ expression, rulefilename, lnnum_minus_one + 1 ]
115
+ Regexp.new('\b' + expression.chomp + '\b' )
116
+ end
117
+ ] = ( reason or "" ) + " (matched '" + expression.chomp +
118
+ "' in %s:%d)" % [ rulefilename, lnnum_minus_one + 1 ]
119
+ # end
120
+ rescue RegexpError => e
121
+ $stderr.puts "#{rulefilename}:#{lnnum_minus_one + 1}: Error: #{e}"
122
+ exit 1
123
+ end
124
+ Censored_phrases.delete(nil)
125
+ end
126
+ }
127
+ else
128
+ []
129
+ end
130
+ }
131
+
132
+ Censored_phrases.delete_if { |regex,reason|
133
+ t = reason.split(/\s+/)[1] =~ /ignore/
134
+ if t then
135
+ puts "deleting #{regex} / #{reason}"
136
+ end
137
+ t
138
+ }
139
+
140
+ # $prefilter = Regexp.new( "(" + Censored_phrases.keys.map { |r| r.source}.join("|") + ")" )
141
+
142
+ # thanks to Adin Rivera for reporting a little bug in the next line.
143
+ PreCensored_phrases[
144
+ Regexp.new(/\.~?\\cite/) ] = "~\\cite{} should precede the period."
145
+ PreCensored_phrases[
146
+ Regexp.new(/\b(from|in|and|with|see)[~ ]+\\cite/) ] = "Don't cite in the sentence as 'in [x]', cites are not nouns. Prefer: Smith et al.~\\cite{...} show ... ."
147
+ PreCensored_phrases[
148
+ Regexp.new(/[^\.\n]\n\n/) ] = "paragraphs should end with a sentence end"
149
+ PreCensored_phrases[
150
+ Regexp.new(/(Table|Figure|Section)[ \n]\\ref/) ] = "Table, Figure, and Section refs should have a non-breaking space"
151
+ PreCensored_phrases[
152
+ Regexp.new(/(table|figure|section)~\\ref/) ] = "Table, Figure, and Section refs should be capitalized"
153
+ PreCensored_phrases[
154
+ Regexp.new(/\\url\{(?!http|ftp|rtsp|mailto)/) ] = "~\\url{} should start with http:// (or ftp or rtsp or maybe mailto)."
155
+
156
+ PctCensored_phrases[
157
+ Regexp.new(/[0-9]%/) ] = "a percent following a number is rarely an intended comment."
158
+ # PctCensored_phrases[
159
+ # Regexp.new(/[<>]/) ] = "a less than or greater than outside math mode shows other characters."
160
+
161
+ if(Censored_phrases.length == 0) then
162
+ puts "no style-censor phrases found. write some in ./style-censor."
163
+ exit 1
164
+ end
165
+ De_comment = Regexp.new('(([^\\\\]%.*)|(^%.*))$')
166
+ # though newcommand could gobble both parameters...
167
+ De_command = Regexp.new('(~?\\\\(' + ignoredCommands.join('|') + ')(\[[^\]]*\])?\{[^{}]*\})')
168
+ De_verb = Regexp.new('\\\\verb(.)[^\1]*\1')
169
+ De_math = Regexp.new('[^\\\\]\$.*[^\\\\]\$|^\$.*[^\\\\]\$')
170
+
171
+ def do_cns(line, file, linenum, phra_hash)
172
+ # if line =~ /\\caption/ && file =~ /Mapping/ then
173
+ # puts "validating: '#{line}'"
174
+ # end
175
+ m = nil
176
+ r = nil # so we can keep it as a side-effect of the detect call
177
+ detected = nil
178
+ windows_detect_bug_avoider = nil
179
+ # if m = $prefilter.match(line) then
180
+ if(detected = phra_hash.keys.detect { |r| m = r.match(line) and (line.index("\n") == nil or m.begin(0) < line.index("\n")) } ) then
181
+ matchedlines = ( m.end(0) <= ( line.index("\n") or 0 ) ) ? line.gsub(/\n.*/,'') : line.chomp
182
+ puts "%s:%d:%s%d: %s (%s)" % [ file, linenum, Gedit_Mode ? ' ': '', m.begin(0)+1, matchedlines, m.to_s.tr("\n", ' ') ]
183
+ $exit_status = 1 if(!phra_hash[detected] =~ /\?\s*$/)
184
+ if($VERBOSE && phra_hash[detected]) then
185
+ puts " " + phra_hash[detected]
186
+ phra_hash[detected] = nil # don't print the reason more than once
187
+ end
188
+ end
189
+ # end
190
+ end
191
+
192
+ Input_files = ARGV
193
+ Input_files.delete_if { |f|
194
+ if !test(?e, f) then
195
+ $stderr.puts "WARNING: Input file #{f} does not exist. skipping."
196
+ true
197
+ else
198
+ false
199
+ end
200
+ }
201
+ Input_files.each { |f|
202
+ in_multiline_comment = 0
203
+ in_multiline_verbatim = false
204
+ in_multiline_equation = false
205
+ # load the file, contents, but drop comments and other
206
+ # hidden tex command pieces
207
+ lines = File.open(f).readlines
208
+ lines.each_with_index { |ln,i|
209
+ do_cns( ln, f, i+1, PctCensored_phrases )
210
+ ln.sub!(De_comment, '')
211
+ # no, I don't know that comment environments nest and verbatim environments dont.
212
+ # I have no such cluefulness.
213
+ if( ln =~ /\\begin\{comment\}/ ) then
214
+ in_multiline_comment+=1
215
+ elsif( ln =~ /\\end\{comment\}/ ) then
216
+ in_multiline_comment-=1
217
+ end
218
+ if( ln =~ /\\begin\{verbatim\}/ ) then
219
+ in_multiline_verbatim=true
220
+ elsif( ln =~ /\\end\{verbatim\}/ ) then
221
+ in_multiline_verbatim=false
222
+ end
223
+ if( ln =~ /\\begin\{(equation|math|eqnarray)\*?\}/ ) then
224
+ in_multiline_equation=true
225
+ elsif( ln =~ /\\end\{(equation|math|eqnarray)\*?\}/ ) then
226
+ in_multiline_equation=false
227
+ end
228
+ if(in_multiline_comment == 0 && ! in_multiline_verbatim && ! in_multiline_equation) then
229
+ do_cns( ln, f, i+1, PreCensored_phrases )
230
+ ln.gsub!(De_command, '~')
231
+ ln.gsub!(De_verb, '~')
232
+ ln.gsub!(De_math, '~')
233
+ do_cns( (ln + ( lines[i+1] or "" ) + ( lines[i+2] or "" )).sub(De_comment, '').sub(De_command, '~'), f, i+1, Censored_phrases )
234
+
235
+ # now try to make sure that paragraphs end with sentence
236
+ # ending punctuation, such as a period, exclamation mark,
237
+ # question mark, or perhaps a command-ending brace.
238
+ if(lines.length > i+3) then
239
+ checkstring = lines[i..(i+1)].map { |ln|
240
+ ln.sub!(De_comment, '');
241
+ ln.sub!(/\\[a-z]+=[0-9]+/, ''); # tex variable assignment; I format each on its own line.
242
+ ln }.join
243
+ #if(checkstring =~ /SIGCOMM/) then
244
+ #puts "%s:%d: argh: %s" % [ f, i, checkstring.gsub(/\n/, '\n') ];
245
+ #end
246
+ if(checkstring =~ /[a-z0-9][^\.\:\!\?\n}]\n\n/) then
247
+ puts "%s:%d: apparent bad paragraph break: %s" % [
248
+ f, i+1, checkstring.gsub(/\n/, '\n') ];
249
+ end
250
+ end
251
+ end
252
+ }
253
+ }
254
+
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: style-check
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.15'
5
+ platform: ruby
6
+ authors:
7
+ - Neil Spring
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |-
14
+ style-check.rb searches latex-formatted text in search of forbidden phrases and
15
+ prints error messages formatted as if from a compiler.
16
+ email: nspring@cs.umd.edu
17
+ executables:
18
+ - style-check.rb
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - bin/style-check.rb
23
+ - lib/style-check.rb
24
+ - lib/rules/bad-words
25
+ - lib/rules/barrass
26
+ - lib/rules/cliche
27
+ - lib/rules/common-typos
28
+ - lib/rules/day-gastel
29
+ - lib/rules/foolish-phrases
30
+ - lib/rules/latex-checking
31
+ - lib/rules/misspellings
32
+ - lib/rules/my-rules
33
+ - lib/rules/networking-research
34
+ - lib/rules/passive-voice
35
+ - lib/rules/verbose-phrases
36
+ homepage: http://www.scriptroute.org/
37
+ licenses:
38
+ - GPL
39
+ metadata: {}
40
+ post_install_message: "Now run: \n% style-check.rb *.tex"
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ requirements: []
55
+ rubyforge_project:
56
+ rubygems_version: 2.0.14
57
+ signing_key:
58
+ specification_version: 4
59
+ summary: Style checker for LaTeX
60
+ test_files: []
61
+ has_rdoc: