User:Lemondoge/Gnomehub
This page contains several searchlinks that can be used by WikiGnomes (such as myself) to locate pages that could use some 'gnomeification — whether they have minor typos, failure to comply with MOS, etc. — along with some regex expressions that might help locate or fix errors while you're already in a page. In addition, it also contains other utilities, such as useful edit summaries or links to guidelines.
Typo searches
[edit]Some typos that are relatively common, or that appear surprisingly often.
it's is
[edit]it's has
[edit]it's has got
[edit]e.t.c.
[edit]etc. is not an acronym
innacurate
[edit]Formatting mistakes
[edit]Errors with formatting, especially those that fail to comply with the MOS.
"Artificial" hatnote
[edit]"See also", "Main article", or "Further information" hatnotes made without using the proper templates (e.g. ''See also: [[Example]]''
rather than {{See also|Example}}
). (NOTE: This search is very expensive.)
Modules that can be simplified
[edit]These searchlinks are for detecting modules with portions that could be simplified. All of these search in the module namespace.
NOTE: The regex here may give false positives; it might match an area that actually cannot be simplified any further.
else if
[edit]else if
can usually be simplified to elseif
.
if a then else
[edit]Can generally be simplified to if not a then
.
if a then return true else return false
[edit]This detects overly verbose return statements.
if not [variable] then error("str")
[edit]Can use assert(variable, "str")
instead.
not [a] == [b]
[edit]Can generally be simplified to [a] ~= [b]
. Note: This searchlink is rather inaccurate, and likely needs improvement.
#[table] > 0
[edit]Is just equivalent to #[table] ~= 0
, since length is a natural number.
#[table] >= 1
[edit]#[table] < 1
[edit]Is just equivalent to #[table] == 0
, since length is a natural number.
nested not
[edit]Catches stuff like not (a and not b)
. Regex is insource:/not[^!-~]*\(([^!-~]*(not[^!-~]+)?[!-~]+[^!-~]+and[^!-~]+not[^!-~]+[!-\<>-\}]+[^!-~]*|[^!-~]*not[^!-~]+?[!-~]+[^!-~]+and[^!-~]+(not[^!-~]+)?[!-\<>-\}]+[^!-~]*)\)/
; too big to fit in button
lorem and (false|nil) or ipsum
[edit]If a module contains x and (false|nil) or y
, it is an error! (false|nil) or y
is always y, so x and (false|nil) or y
will ALWAYS yield y.
nested if
[edit]Detects modules with unnecessarily nested if statements; however, will not give you the location in the search results. Note: HIGHLY inaccurate
Invalid escape sequence
[edit]Attempts to use backslashes to escape certain characters in strings, especially patterns. Usually, this is because % should have been used instead of a backslash. (See the lua reference for valid escape sequences, except that \[ and \] don't actually work.)
Note: This will successfully avoid matching even numbers of backslashes (it won't match something like \\-
). However, as a compromise due to the lack of support for lookbehinds, the regex will also harmlessly consume one character behind the first backslash.
tonumber(a (and|or) 'string')
[edit]Overly verbose "tonumber" statements. Slightly inaccurate, but can be refined.
[^%d]
and similar
[edit]%d%d*
[edit]Regexes
[edit]A few regular expressions that might be helpful for finding errors via search and replace:
Nested link
[edit]/\[((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?) \[\[/
Edit summaries
[edit]Useful edit summaries to provide justification for gnome actions.
Spelling or grammar correction in a quotation
[edit]Mild (grammar/spelling) correction in quotation; although this error might have been in the original quotation, [[MOS:SIC]] says to silently correct insignificant spelling and typographic errors in quotations.
Wikipedia policy resources
[edit]Some Wikipedia policies that you can cite in your edit summaries
- MOS:SIC: says to silently correct insignificant spelling and typographic errors in quotations.
- MOS:OL: things that shouldn't be linked
- MOS:PF: references should usually go after punctuation instead of before