package Ġcom . github . z 3 d 1 k . maven . plugin . kt lint . rules Ċ Ċ import Ġcom . p interest . kt lint . core . Rule Ċ import Ġcom . p interest . kt lint . core . Rule Set Ċ import Ġcom . p interest . kt lint . core . Rule Set Provider Ċ import Ġcom . p interest . kt lint . rule set . experimental . Experimental Rule Set Provider Ċ import Ġcom . p interest . kt lint . rule set . standard . Standard Rule Set Provider Ċ import Ġorg . apache . commons . lang 3 . Random StringUtils Ċ import Ġorg . jetbrains . kotlin . com . intellij . lang . AST Node Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . JUnit 4 Ċ import Ġkotlin . test . assertEquals Ċ import Ġkotlin . test . assertTrue Ċ Ċ @ RunWith ( JUnit 4 :: class ) Ċ class ĠRule Sets Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` experimental Ġrule Set Ġshould Ġbe Ġignored Ġif Ġexperimental Ġrules Ġare Ġdisabled `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule Set Providers Ġ= ĠgetRandom Rule Set Providers ( 1 0 ) Ġ+ Ġstandard Rule Set Provider Ġ+ Ġexperimental Rule Set Provider ĊĠĠĠĠĠĠĠ Ġval Ġresolved Rule Sets Ġ= Ġresolve Rule Sets ( enable Experimental Rules Ġ= Ġfalse , Ġproviders Ġ= Ġrule Set Providers ) ĊĊĠĠĠĠĠĠĠ ĠassertTrue ( resolved Rule Sets . none Ġ{ Ġrule Set Ġ-> Ġrule Set . id Ġ== Ġexperimental Rule Set Provider . get (). id Ġ}) ĊĠĠĠĠĠĠĠ ĠassertEquals ( rule Set Providers . size Ġ- Ġ 1 , Ġresolved Rule Sets . size ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` experimental Ġrule Set Ġshould Ġbe Ġincluded Ġif Ġexperimental Ġrules Ġare Ġenabled `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule Set Providers Ġ= ĠgetRandom Rule Set Providers ( 1 0 ) Ġ+ Ġstandard Rule Set Provider Ġ+ Ġexperimental Rule Set Provider ĊĠĠĠĠĠĠĠ Ġval Ġresolved Rule Sets Ġ= Ġresolve Rule Sets ( enable Experimental Rules Ġ= Ġtrue , Ġproviders Ġ= Ġrule Set Providers ) ĊĊĠĠĠĠĠĠĠ ĠassertTrue ( resolved Rule Sets . any Ġ{ Ġrule Set Ġ-> Ġrule Set . id Ġ== Ġexperimental Rule Set Provider . get (). id Ġ}) ĊĠĠĠĠĠĠĠ ĠassertEquals ( rule Set Providers . size , Ġresolved Rule Sets . size ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` standard Ġrule Set Ġshould Ġbe Ġfirst `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrule Set Providers Ġ= ĠgetRandom Rule Set Providers () Ġ+ Ġstandard Rule Set Provider Ġ+ Ġexperimental Rule Set Provider ĊĠĠĠĠĠĠĠ Ġval Ġresolved Rule Sets Ġ= Ġresolve Rule Sets ( providers Ġ= Ġrule Set Providers ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( resolved Rule Sets . first (). id , Ġstandard Rule Set Provider . get (). id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġlowercase Alphabet Ġ= Ġ" abcdefgh ijkl mnopqrst uvw xyz " ĊĊĠĠĠĠĠĠĠ Ġval Ġstandard Rule Set Provider Ġ= ĠStandard Rule Set Provider () ĊĠĠĠĠĠĠĠ Ġval Ġexperimental Rule Set Provider Ġ= ĠExperimental Rule Set Provider () ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġget Empty Rule Set Provider (): ĠRule Set Provider Ġ= Ġobject Ġ: ĠRule Set Provider Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget (): ĠRule Set Ġ= ĠRule Set ( Random StringUtils . random ( 1 5 , Ġlowercase Alphabet ), ĠNo Op Rule ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun ĠgetRandom Rule Set Providers ( count : ĠInt Ġ= Ġ 1 0 ): ĠList < Rule Set Provider > Ġ= ĠList ( count ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġget Empty Rule Set Provider () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġinternal Ġclass ĠNo Op Rule ( id : ĠString Ġ= ĠRandom StringUtils . random ( 1 5 , Ġlowercase Alphabet )) Ġ: ĠRule ( id ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġvisit ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnode : ĠAST Node , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġauto Correct : ĠBoolean , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġemit : Ġ( offset : ĠInt , ĠerrorMessage : ĠString , Ġcan Be Auto Correct ed : ĠBoolean ) Ġ-> ĠUnit ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) Ġ= ĠUnit ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ