| # This was copied from google3/devtools/linter/common_typos/typos.txt on |
| # 2017-11-03 and modified to be compatible with the python re module. |
| |
| # NOTE: Typos here will apply to documentation, code, comments, and commit |
| # messages. Please make sure that you do not add any typos here that exist in |
| # projects' external dependencies (e.g. as part of a different project's API). |
| # |
| # Regular expressions on the left are replaced with those on the right. |
| # |
| # If you update this with anything complex, please add a corresponding test or |
| # two for both positive and negative examples. |
| # |
| # Mostly taken and/or adapted from http://sites/lolcodesearch. |
| # |
| # Be careful with optional capture groups and references - optional groups |
| # must be transformed as "(abc)?" -> "(abc|)", otherwise it may throw an |
| # exception if the optional group isn't matched but is referenced in expansion. |
| # |
| # Only RE2 syntax regular expressions are supported. Backreferences and |
| # negative assertions make the expression non-regular, and take worst-case |
| # exponential time. |
| # |
| # The typo fixer will ignore any suggestsions in which the original and the |
| # suggested fix are the same, which can be useful since it is sometimes |
| # to make a simple regex that matches all the misspellings while not matching |
| # the correct spelling. |
| |
| # pylint: disable=line-too-long |
| |
| from __future__ import absolute_import |
| import collections |
| Typo = collections.namedtuple('Type', ['typo_pattern', 'replacement_pattern']) |
| |
| TYPOS = [ |
| Typo(r'(a|)syncho(r|ro|)(r|n)ous(ly|)', r'\1synchronous\4'), |
| Typo(r'(con|de)(stuct|truct|cruct)', r'\1struct'), |
| Typo(r'(c|sh|w)oudl', r'\1ould'), |
| Typo(r'(c|sh|w)oul(e|n|s|t)', r'\1ould'), |
| Typo(r'(depricate|depreciate|deperecate)(d|)', r'deprecate\2'), |
| Typo(r'(m|re|)maping', r'\1mapping'), |
| Typo(r'(not|mod)(if|fi)cation(s|)', r'\1ification\3'), |
| Typo(r'(not|mod)ifica(iton|toin)(s|)', r'\1ification\3'), |
| Typo(r'(pre|)sumbit', r'\1submit'), |
| Typo(r'(proto|)tpye(s|)', r'\1type\2'), |
| Typo(r'(un|)healhty', r'\1healthy'), |
| Typo(r'(re|)genrate(ed|)', r'\1generate\2'), |
| Typo(r'\b(flase|fales|fasle)\b', r'false'), |
| Typo(r'\b(more|less|greater|lesser|bigger|smaller)(\s+)then\b', |
| r'\1\2than'), |
| Typo(r'\b(ture|treu)\b', r'true'), |
| Typo(r'\b(uknown|unkown|unkwon|unkowon)\b', r'unknown'), |
| Typo(r'\b(un|)singed\b', r'\1signed'), |
| Typo(r'\balot\b', r'a\x20lot'), |
| Typo(r'\bandoid\b', r'android'), |
| Typo(r'\bbalue\b', r'value'), |
| Typo(r'\bcorn(\s|)job', r'cron\1job'), |
| Typo(r'\bfrist\b', r'first'), |
| Typo(r'\bgrammer\b', r'grammar'), |
| Typo(r'\bit\sself(\.|)([^-a-zA-Z\.]|$)', r'itself\1\2'), |
| Typo(r'\bommitted', r'omitted'), |
| Typo(r'\bsmapl(e[rsd]?|ing)\b', r'sampl\1'), |
| Typo(r'\btaget\b', r'target'), |
| Typo(r'\bthier\b', r'their'), |
| Typo(r'\btread(.|)safe\b', r'thread\1safe'), |
| Typo(r'acccount', r'account'), |
| Typo(r'accessibile', r'accessible'), |
| Typo(r'accomodat(e|ion)', r'accommodat\1'), |
| Typo(r'accross', r'across'), |
| Typo(r'acitiv(e|ity)', r'activ\1'), |
| Typo(r'activites', r'activities'), |
| Typo(r'acutally', r'actually'), |
| Typo(r'\badition', r'addition'), |
| Typo(r'adress', r'address'), |
| Typo(r'aggragat(e|ed|ing|ion)', r'aggregat\1'), |
| Typo(r'aggree', r'agree'), |
| Typo(r'agressive', r'aggressive'), |
| Typo(r'ajust', r'adjust'), |
| Typo(r'alredy', r'already'), |
| Typo(r'andriod', r'android'), |
| Typo(r'applicaiton(s|)', r'application\1'), |
| Typo(r'argu(e|)me?nt(s|)', r'argument\2'), |
| Typo(r'arround', r'around'), |
| Typo(r'asign', r'assign'), |
| Typo(r'assosciated', r'associated'), |
| Typo(r'asume', r'assume'), |
| Typo(r'atribute', r'attribute'), |
| Typo(r'authentification', r'authentication'), |
| Typo(r'availiability', r'availability'), |
| Typo(r'availiable|avaliable', r'available'), |
| Typo(r'bandwith', r'bandwidth'), |
| Typo(r'baord', r'board'), |
| Typo(r'bec(u|)ase\b', r'because'), |
| Typo(r'befor\b', r'before'), |
| Typo(r'begining', r'beginning'), |
| Typo(r'borgcorn', r'borgcron'), |
| Typo(r'bormgon', r'borgmon'), |
| Typo(r'breif', r'brief'), |
| Typo(r'bulid(er|s|ing|)', r'build\1'), |
| Typo(r'calender', r'calendar'), |
| Typo(r'capbilit(y|ies)', r'capabilit\1'), |
| Typo(r'cannonical', r'canonical'), |
| Typo(r'celcius', r'Celsius'), |
| Typo(r'chagne', r'change'), |
| Typo(r'chanel', r'channel'), |
| Typo(r'charachter(s|)', r'character\1'), |
| Typo(r'choosen\b', r'chosen'), |
| Typo(r'choses\b', r'chooses'), |
| Typo(r'chrome(cats|csat)', r'chromecast'), |
| Typo(r'cilent', r'client'), |
| Typo(r'classif(er|cation)', r'classifi\1'), |
| Typo(r'columio', r'columnio'), |
| Typo(r'com+it+(ed|ing)\b', r'committ\1'), |
| Typo(r'comming\b', r'coming'), |
| Typo(r'comparision', r'comparison'), |
| Typo(r'compatability', r'compatibility'), |
| Typo(r'complier', r'compiler'), |
| Typo(r'(pre|)comptuation(s|)', r'\1computation\2'), |
| Typo(r'consistant', r'consistent'), |
| Typo(r'contaning', r'containing'), |
| Typo(r'contant(s|)', r'constant\1'), |
| Typo(r'contians', r'contains'), |
| Typo(r'continous', r'continuous'), |
| Typo(r'convertable', r'convertible'), |
| Typo(r'convertion', r'conversion'), |
| Typo(r'correspondan(ce|t)', r'corresponden\1'), |
| Typo(r'cosnt', r'const'), |
| Typo(r'course(.|)grained', r'coarse\1grained'), |
| Typo(r'curent\b', r'current'), |
| Typo(r'currenty', r'currently'), |
| Typo(r'dashborad', r'dashboard'), |
| Typo(r'deatil(s|ed|)', r'detail\1'), |
| Typo(r'deafult(s|)', r'default\1'), |
| Typo(r'definately', r'definitely'), |
| Typo(r'defintion(s|)', r'definition\1'), |
| Typo(r'dep(d|)e(n|)de(n|)c(y|ies)', r'dependenc\4'), |
| Typo(r'descritp(ions?|ors?)', r'descript\1'), |
| Typo(r'destript(ions?|ors?)', r'descript\1'), |
| Typo(r'deterine(s|d|)', r'determine\1'), |
| Typo(r'diferent', r'different'), |
| Typo(r'dimention', r'dimension'), |
| Typo(r'direcory', r'directory'), |
| Typo(r'dispatcer', r'dispatcher'), |
| Typo(r'egde(s|)', r'edge\1'), |
| Typo(r'elasped', r'elapsed'), |
| Typo(r'embeded', r'embedded'), |
| Typo(r'emmitt(ed|ing|er)', r'emitt\1'), |
| Typo(r'encryted', r'encrypted'), |
| Typo(r'encyrption', r'encryption'), |
| Typo(r'enity', r'entity'), |
| Typo(r'entires', r'entries\1'), |
| Typo(r'enviroment', r'environment'), |
| Typo(r'errror(s|)', r'error\1'), |
| Typo(r'estiamt(or|ed|e)', r'estimat\1'), |
| Typo(r'excecute', r'execute'), |
| Typo(r'excede', r'exceed'), |
| Typo(r'excelent', r'excellent'), |
| Typo(r'excercise', r'exercise'), |
| Typo(r'exisiting', r'existing'), |
| Typo(r'existan(t|ce)\b', r'existen\1'), |
| Typo(r'exmaple', r'example'), |
| Typo(r'expe(rie|ir|iri)ment(s|)', r'experiment\2'), |
| Typo(r'explicitely', r'explicitly'), |
| Typo(r'extenstion', r'extension'), |
| Typo(r'extention', r'extension'), |
| Typo(r'f(in|ni)shed', r'finished'), |
| Typo(r'farenheit', r'Fahrenheit'), |
| Typo(r'feas(i|a)b(i|)(le|ility)', r'feasib\3'), |
| Typo(r'fitler', r'filter'), |
| Typo(r'format(tt|)(ing|ed)', r'formatt\2'), |
| Typo(r'foward', r'forward'), |
| Typo(r'frequecy', r'frequency'), |
| Typo(r'func(iton|toin)(s|al|ed|ing|)', r'function\2'), |
| Typo(r'funtion', r'function'), |
| Typo(r'goole|googel|goolge', r'google'), |
| Typo(r'guaratee(d|)', r'guarantee\1'), |
| Typo(r'gurantee(d|)', r'guarantee\1'), |
| Typo(r'hanlder(s|)', r'handler\1'), |
| Typo(r'heigth', r'height'), |
| Typo(r'heirarchy', r'hierarchy'), |
| Typo(r'identifer(s|)', r'identifier\1'), |
| Typo(r'idenfifier(s|)', r'identifier\1'), |
| Typo(r'ignroe(d|s|)', r'ignore\1'), |
| Typo(r'impresssion', r'impression'), |
| Typo(r'ind(e|i)cies', r'indices'), |
| Typo(r'indeces', r'indices'), |
| Typo(r'indentif(ication|ied|ies|ier|iers|y|ying)', r'identif\1'), |
| Typo(r'independant', r'independent'), |
| Typo(r'ingored', r'ignored'), |
| Typo(r'inhert', r'inherit'), |
| Typo(r'initialzing', r'initializing'), |
| Typo(r'initialzi(ed|er|ers|es|ation)', r'initializ\1'), |
| Typo(r'instanciat(ed|ion|ions|e)', r'instantiat\1'), |
| Typo(r'instantitation', r'instantiation'), |
| Typo(r'intead', r'instead'), |
| Typo(r'interable', r'iterable'), |
| Typo(r'interator', r'iterator'), |
| Typo(r'interchangabl(e|y)', r'interchangeabl\1'), |
| Typo(r'interger', r'integer'), |
| Typo(r'intermittant', r'intermittent'), |
| Typo(r'intial(ly|)', r'initial\1'), |
| Typo(r'intializ(e|ed|er|ers|ing|ation|)', r'initializ\1'), |
| Typo(r'(in|)vlaid(ate|ated|)', r'\1valid\2'), |
| Typo(r'invokation', r'invocation'), |
| Typo(r'irregardless', r'regardless'), |
| Typo(r'javasscript', r'javascript'), |
| Typo(r'(ack|)knowlege(ment|d|)(s|)', r'\1knowledge\2\3'), |
| Typo(r'aknowle(d|)ge(ment|d|)(s|)', r'acknowledge\2\3'), |
| Typo(r'lamda', r'lambda'), |
| Typo(r'langauge(s|)', r'language\1'), |
| Typo(r'lastest', r'latest'), |
| Typo(r'lealaps', r'laelaps'), |
| Typo(r'lenght(s|)', r'length\1'), |
| Typo(r'libasis+[tan]+', r'libassistant'), |
| Typo(r'libary', r'library'), |
| Typo(r'listner', r'listener'), |
| Typo(r'locaiton(s|)', r'location\1'), |
| Typo(r'looup', r'lookup'), |
| Typo(r'managment', r'management'), |
| Typo(r'maxumum', r'maximum'), |
| Typo(r'maintenace', r'maintenance'), |
| Typo(r'meatadata|meatdata', r'metadata'), |
| Typo(r'medatata', r'metadata'), |
| Typo(r'migation', r'migration'), |
| Typo(r'moniter(s|ed|ing|able|)', r'monitor\1'), |
| Typo(r'mutiple|mulitple', r'multiple'), |
| Typo(r'neccessary', r'necessary'), |
| Typo(r'necesar(y|ily)', r'necessar\1'), |
| Typo(r'newstand', r'newsstand'), |
| Typo(r'nulltpr', r'nullptr'), |
| Typo(r'oc+ur+(a|e)nce', r'occurrence'), |
| Typo(r'occur(ed|ing)', r'occurr\1'), |
| Typo(r'offical', r'official'), |
| Typo(r'or(gi|ig)nal', r'original'), |
| Typo(r'ove(r|)riden', r'overridden'), |
| Typo(r'overide', r'override'), |
| Typo(r'ove(r|)rite', r'overwrite'), |
| Typo(r'ove(r|)rites', r'overwrites'), |
| Typo(r'ove(r|)rit(t|)en', r'overwritten'), |
| Typo(r'pacakge', r'package'), |
| Typo(r'paramter(s|)', r'parameter\1'), |
| Typo(r'path[aei]logical', r'pathological'), |
| Typo(r'permanant', r'permanent'), |
| Typo(r'platfrom|paltform|platfom|patform|plaftorm', r'platform'), |
| Typo(r'peroid(ic|ical|ically|)', r'period\1'), |
| Typo(r'persistant', r'persistent'), |
| Typo(r'pipeling|pipline', r'pipeline'), |
| Typo(r'postion', r'position'), |
| Typo(r'postive', r'positive'), |
| Typo(r'preceed(ed|ing)', r'preced\1'), |
| Typo(r'precodition(s|)', r'precondition\1'), |
| Typo(r'pref+er+ed', r'preferred'), |
| Typo(r'pref+er+[ae]nce(s|)', r'preference\1'), |
| Typo(r'presedence', r'precedence'), |
| Typo(r'(p|)revew|reviw(ed|s|)', r'\1review\2'), |
| Typo(r'proably', r'probably'), |
| Typo(r'procede', r'proceed'), |
| Typo(r'proces(ing|ed|es)', r'process\1'), |
| Typo(r'produciton', r'production'), |
| Typo(r'programatic(ally|)', r'programmatic\1'), |
| Typo(r'prohibitted', r'prohibited'), |
| Typo(r'propogat(ion|ed|es|e)', r'propagat\1'), |
| Typo(r'protocal', r'protocol'), |
| Typo(r'proudction', r'production'), |
| Typo(r'psuedo', r'pseudo'), |
| Typo(r'pubicly', r'publicly'), |
| Typo(r'publically', r'publicly'), |
| Typo(r'\bputing\b', r'putting'), |
| Typo(r'qualificaiton(s|)', r'qualification\1'), |
| Typo(r'realease', r'release'), |
| Typo(r'recieve', r'receive'), |
| Typo(r'recomend(ation|ations|s|ing|)', r'recommend\1'), |
| Typo(r'recrod', r'record'), |
| Typo(r'relase', r'release'), |
| Typo(r'relevent', r'relevant'), |
| Typo(r'(ir|)relvant', r'\1relevant'), |
| Typo(r'reponse|respone', r'response'), |
| Typo(r'reponsibilit(y|ies)', r'responsibilit\1'), |
| Typo(r'reqeust(s|ed|ing|)', r'request\1'), |
| Typo(r'reserach', r'research'), |
| Typo(r'(re|)sopurce', r'\1source'), |
| Typo(r'responsabilit(y|ies)', r'responsibilit\1'), |
| Typo(r'resopnse', r'response'), |
| Typo(r'resovl(e[sd]?|ing)', r'resolv\1'), |
| Typo(r'retre?ive(d|s|)', r'retrieve\1'), |
| Typo(r'retrival', r'retrieval'), |
| Typo(r'runnning', r'running'), |
| Typo(r'saftey', r'safety'), |
| Typo(r'san[ietz]+r', r'sanitizer'), |
| Typo(r'seconary', r'secondary'), |
| Typo(r'seperate(d|s|)', r'separate\1'), |
| Typo(r'serach', r'search'), |
| Typo(r'shoppping', r'shopping'), |
| Typo(r'similiar', r'similar'), |
| Typo(r'singals', r'signals'), |
| Typo(r'snasphot', r'snapshot'), |
| Typo(r'specical', r'special'), |
| Typo(r'speficying', r'specifying'), |
| Typo(r'standart', r'standard'), |
| Typo(r'starteg(ies|y)', r'strateg\1'), |
| Typo(r'statment', r'statement'), |
| Typo(r'stich(ed|ing)', r'stitch\1'), |
| Typo(r'stirng', r'string'), |
| Typo(r'stroage', r'storage'), |
| Typo(r'su+c+e+s+(ful|es|)', r'success\1'), |
| Typo(r'su+p+e+r+o+t+', r'superroot'), |
| Typo(r'substract', r'subtract'), |
| Typo(r'successfuly', r'successfully'), |
| Typo(r'sufix', r'suffix'), |
| Typo(r'sugest', r'suggest'), |
| Typo(r'sycn', r'sync'), |
| Typo(r'syncronize', r'synchronize'), |
| Typo(r'threre(after|fore|)', r'there\1'), |
| Typo(r'threshould|thershold', r'threshold'), |
| Typo(r'throught', r'through'), |
| Typo(r'thumnail', r'thumbnail'), |
| Typo(r'transfer(ing|ed)', r'transferr\1'), |
| Typo(r'transation', r'transaction'), |
| Typo(r'tricoder', r'tricorder'), |
| Typo(r'uderlying', r'underlying'), |
| Typo(r'udpate', r'update'), |
| Typo(r'undefiend', r'undefined'), |
| Typo(r'unkown', r'unknown'), |
| Typo(r'virutal', r'virtual'), |
| Typo(r'weigth(s|ing|)', r'weight\1'), |
| Typo(r'wether', r'whether'), |
| Typo(r'wierd(ness|o|)', r'weird\1'), |
| Typo(r'worfklow', r'workflow'), |
| Typo(r'writen', r'written'), |
| Typo(r'writting', r'writing'), |
| Typo(r'zweiback', r'zwieback'), |
| Typo(r'\bGoogle,(\s+)Inc\.?\b', r'Google\1Inc.'), |
| Typo(r'\band\s+and\b', r'and'), |
| Typo(r'\bif\s+if\b', r'if'), |
| Typo(r'\bit\s+it\b', r'it'), |
| Typo(r'\bof\s+of\b', r'of'), |
| Typo(r'\bthe\s+its\b', r'its'), |
| Typo(r'\bthe\s+the\b', r'the'), |
| Typo(r'\bwith\s+with\b', r'with'), |
| Typo(r'\bObjective\sC\b', r'Objective-C'), |
| Typo(r'http(s|):\/\/\/', r'http\1://'), |
| Typo(r'https:\/\/([[:alnum:]]+)\/', r'http://\1/'), |
| Typo(r'ouptut|ouput|outout|OUPTUT|OUPUT', r'output'), |
| Typo(r'A-za-z', r'A-Za-z'), |
| Typo(r'a-zA-z', r'a-zA-Z'), |
| Typo( |
| r'^(|.*[^TtRrSsEe])(TOOO|TOD0|TODI|TODP|TOO|TOSO|TODDO|TOOD|TOCO|TOTO|ODO|TDOO|TODOD|TOFO|TDDO|TODD|TOD|TODOO|TDO|TODL)\W?\(\s*(([a-z]{1,14}@?)|(b.?\d+))\s*\)', |
| r'\1TODO(\3)'), |
| ] |