arcanist-linters A collection of custom Arcanist l开源项目

我要开发同款
匿名用户2021年11月23日
120阅读

技术信息

开源地址
https://gitee.com/MTrun/react-big-screen
授权协议
Apache-2.0 License

作品详情

ArcaistLiters

ThisisacollectioofcustomArcaistlitersthatwe'vewritteatPiterest.

ApacheThriftApacheThriftGeeratedBlackCheckstyleESLitFlake8FlawfiderGoVetGraphQLSchemaLiterOpeAPIValidatorPrettierPrettierESLitPylitPyrightPythoImportsPythoisortPythoRequiremetsSpectralThriftCheck

Wealsowelcomeadditioalcotributios.

LitersApacheThrift

LitsforerrorsiApacheThriftIDL(schema)filesusigthethriftcompiler.

{"type":"thrift","iclude":"(\\.thrift$)","flags":["--allow-64bit-costs"],"versio":">=0.9.0","thrift.geerators":["py:dyamic,utf8strigs,ew_style,slots","java","go","erl"],"thrift.icludes":[".","commo"]}ApacheThriftGeerated

LitsfilesgeeratedbytheApacheThriftcompilertoesuretheyweregeeratedusigasupportedThriftcompiler.

{"type":"thrift-ge","iclude":"(^schemas/.*\\.py$)","thrift-ge.versio":">=0.9.3"}

Note:CurretlyolygeeratedPythofilesaresupported.

Black

UsestheBlackopiioatedcodeformattertoormalizetheformatofPythocode.

{"type":"black","iclude":"(\\.py$)","flags":["-S","--lie-legth=132"]}Checkstyle

UsestheCheckstyletooltocheckJavacodeagaistacodigstadard.

{"type":"checkstyle","iclude":"(\\.java$)","checkstyle.cofig":"google_check.xml"}ESLit

LitsJavaScriptadJSXfilesusigESLit.

{"type":"eslit","iclude":"(\\.js$)","bi":"./ode_modules/.bi/eslit","eslit.cofig":"~/my-eslit.jso","eslit.ev":"browser,ode"}Flake8

LitsPythosourcefilesusigFlake8.ThisisaextededversioofthestockArcaistFlake8LiterthataddssupportforcheckigrequiredPythoadextesioversios.

{"type":"flake8ext","iclude":"(\\.py$)","flake8.pytho":"<3.0","flake8.extesios":{"assertive":"1.0.1","amig":"0.7.0"}}Flawfider

LitsC/C++sourcefilesusigflawfider.

{"type":"flawfider","iclude":"(\\.(c|cc|cpp|h)$)"}GraphQLSchemaLiter

LitGraphQLSchemaDefiitioLaguage(SDL)usiggraphql-schema-liter.

{"type":"graphql-schema","iclude":"(\\.(graphql|gql)$)","graphql-schema.rules":["fields-have-descriptios","types-have-descriptios"],"graphql-schema.cofig":"cofig","graphql-schema.custom-rules":["cofig/custom-rules/*.js","vedor/extra-graphql-rules/*.js"],"graphql-schema.igore":{"fields-have-descriptios":["Obvious","Query.obvious","Query.somethig.obvious"]},"graphql-schema.commet-descriptios":false,"graphql-schema.old-implemets-sytax":false}GoVet

UsestheGovetcommadtolitforsuspiciouscodecostructs.

{"type":"govet","iclude":"(^src/example.com/.*\\.go$)"}OpeAPIValidator

LitOpeAPIspecificatiosusigopeapi-validator.

(Supportsopeapi-validatorversio0.36.0adlater.)

{"type":"opeapi-spec","versio":">=0.36.0","opeapi-spec.cofig":".validaterc","opeapi-spec.debug":false,"opeapi-spec.errors_oly":true,"iclude":["(\\.yaml$)"]}Prettier

FormatsJavaScriptusigPrettier.

{"type":"prettier","iclude":"(\\.js$)","bi":"./ode_modules/.bi/prettier","prettier.cwd":"./"}PrettierESLit

FormatsJavaScriptusigPrettieradthefixeswithESLit.

{"type":"prettier-eslit","iclude":"(\\.js$)","bi":"./ode_modules/.bi/prettier-eslit","prettier-eslit.cwd":"./"}PythoImports

LitsforillegalPythomoduleimports.

{"type":"pytho-imports","pytho-imports.patter":"(mock)","iclude":"(\\.py$)","exclude":"(^tests/)"}Pythoisort

LitsPythoimportsusigisort.

{"type":"isort","iclude":"(\\.py$)"}Pylit

LitsPythousigpylit.UlikethemodulethatshipswithArcaist,thisimplemetatioworkswithrecetreleasesofPylitadalsosupportsvirtualeviromets.

{"type":"piterest-pylit","iclude":"(\\.py$)"}Pyright

Type-checksPythocodeusigPyright.

{"type":"pyright","iclude":"(\\.py$)"}PythoRequiremets

EsuresPythopackagerequiremetsirequiremets.txtfilesaresorted,uique,adpiedtoexactversios.

{"type":"requiremets-txt","iclude":"(requiremets.txt$)"}

Idividualrequiremetliescabeexcludedbyaddiga#oqacommet:

six>=1.10.0#oqa:allowayrecetversioofsixSpectral

LitsOpeAPIdocumetsusigSpectral.

{"type":"spectral","iclude":"(opeapi.yaml)","spectral.ruleset":".spectral.yml",}ThriftCheck

LitsThriftIDLfilesusigThriftCheck.

{"type":"thriftcheck","iclude":"(\\.thrift$)","thriftcheck.cofig":".thriftcheck.toml","thriftcheck.icludes":[".","commo"]}Istallatio

Ishort,you'lleedtoaddthisrepositorytoyourlocalmachieadtellArcaisttoloadtheextesio.Youeithercadothisgloballyoroaper-projectbasis.

Oceistalled,theidividualliterscabeeabledadcofiguredviatheproject's.arclitfile.SeetheArcaistLitUserGuidefordetails.

GlobalIstallatio

Arcaistcaloadmodulesfromaabsolutepath,butbecauseitalsosearchesformodulesoelevelupfromitselfothefilesystem,it'scoveiettocloethisrepositoryatthesamelevelasarcaistadlibphutil.

$gitcloehttps://github.com/piterest/arcaist-liters.gitpiterest-liters$lsarcaistpiterest-literslibphutil

The,tellArcaisttoloadthemodulebyeditig~/.arccofig(or/etc/arccofig):

{"load":["piterest-liters"]}ProjectIstallatio

Youcaalsoloadarcaist-litersoaper-projectbasis.Ithatcase,usigagitsubmoduleisprobablythemostcoveietapproach.

$gitsubmoduleaddhttps://github.com/piterest/arcaist-liters.git.piterest-liters$gitsubmoduleupdate--iit

The,eablethemoduleiyourproject-level.arccofigfile:

{"load":[".piterest-liters"]}

功能介绍

Arcanist Linters This is a collection of custom Arcanist linters that we've written at Pinterest....

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论