IdentyPo هي أداة تحليل ثابت GO لإيجاد الأخطاء المطبعية في المعرفات (الوظائف ، مكالمات الوظائف ، المتغيرات ، الثوابت ، إعلانات النوع ، الحزم ، الملصقات) بما في ذلك وظائف Camelcared ، المتغيرات ، إلخ.
go get -u github.com/alexkohler/identypo/cmd/identypo
يعمل misspell في النص الخام والتعليقات. تعمل identypo على معرفات AST (أي أسماء متغيرة ، أسماء الوظائف ، إلخ). علاوة على ذلك ، يقسم identypo كل معرف معتمد إذا لزم الأمر (يتحول MyIdudeFierName إلى "اسم المعرفي الخاص بي") قبل تحليل ما إذا كان يتم توضيحه بشكل صحيح أم لا. تحت الغطاء ، يستخدم identypo محرك Elphecking من Misspell لتحديد ما إذا لم يتم تهجئة كلمة معينة بشكل صحيح.
على غرار أدوات التحليل الثابتة الأخرى (مثل Golint أو GO VET) ، يمكن استدعاء IdentyPo بأسماء أو أكثر أو أكثر من أسماء الملفات أو الدلائل أو الحزم التي يسمى مسار الاستيراد. identypo يدعم أيضا ... wildcard. بشكل افتراضي ، سوف يبحث عن الأخطاء المطبعية في كل معرف (الوظائف ، ومكالمات الوظائف ، والمتغيرات ، والثوابت ، وإعلانات النوع ، والطاقات ، والعلامات).
identypo [flags] files/directories/packages
-i="nto,creater" ). هذا هو تمريرة مباشرة إلى حزمة الأخطاء الإملائية.ملاحظة: بشكل افتراضي ، ستقوم IdentyPo بالتحقق من الأخطاء المطبعية في كل معرف (وظائف ، مكالمات الوظائف ، المتغيرات ، الثوابت ، إعلانات النوع ، الحزم ، الملصقات). في هذه الحالة ، لا توجد علم يحتاج إلى محدد. نظرًا لعدم وجود تواتر ، لا توجد حاليًا أي أعلام للعثور على إعلانات النوع أو الحزم أو الملصقات فقط.
بعض الأمثلة من المكتبة القياسية GO (باستخدام علامة -i لقمع بعض غير القضايا):
$ identypo -i= " rela,nto,onot,alltime " ./...
cmd/trace/goroutines.go:169 " dividened " should be dividend in dividened
cmd/trace/goroutines.go:173 " dividened " should be dividend in dividened
cmd/trace/goroutines.go:175 " dividened " should be dividend in dividened
cmd/trace/goroutines.go:179 " dividened " should be dividend in dividened
cmd/trace/annotations.go:1162 " dividened " should be dividend in dividened
cmd/trace/annotations.go:1166 " dividened " should be dividend in dividened
cmd/trace/annotations.go:1168 " dividened " should be dividend in dividened
cmd/trace/annotations.go:1172 " dividened " should be dividend in dividened
crypto/x509/verify.go:208 " Comparisions " should be Comparisons in MaxConstraintComparisions
crypto/x509/verify.go:585 " Comparisions " should be Comparisons in MaxConstraintComparisions // cmd/trace/annotations.go:1162 dividened" should be dividend in dividened
"percent" : func ( dividened , divisor int64 ) template. HTML {
// crypto/x509/verify.go:208 "Comparisions" should be Comparisons in MaxConstraintComparisions
type VerifyOptions struct {
...
MaxConstraintComparisions int
}بعض الأمثلة المختارة من Kubernetes:
$ identypo ./...
cmd/kubeadm/app/util/apiclient/wait.go:51 " inital " should be initial in initalTimeout
pkg/apis/certificates/types.go:125 " Committment " should be Commitment in UsageContentCommittment
test/e2e_node/eviction_test.go:51 " Dissapear " should be Disappear in pressureDissapearTimeout
pkg/scheduler/scheduler_test.go:705 " Satsified " should be Satisfied in FindUnboundSatsified
pkg/kubectl/cmd/scale.go:265 " Psuedo " should be Pseudo in JobPsuedoScaler // cmd/kubeadm/app/util/apiclient/wait.go:51 "inital" should be initial in initalTimeout
WaitForHealthyKubelet ( initalTimeout time . Duration , healthzEndpoint string ) error
// pkg/apis/certificates/types.go:125 "Committment" should be Commitment in UsageContentCommittment
UsageContentCommittment KeyUsage = "content commitment"
// test/e2e_node/eviction_test.go:51 "Dissapear" should be Disappear in pressureDissapearTimeout
const (
...
pressureDissapearTimeout = 1 * time . Minute
...
)
// pkg/scheduler/scheduler_test.go:705 "Satsified" should be Satisfied in FindUnboundSatsified
volumeBinderConfig: & persistentvolume. FakeVolumeBinderConfig {
...
FindUnboundSatsified : true ,
...
}
// pkg/kubectl/cmd/scale.go:265 "Psuedo" should be Pseudo in JobPsuedoScaler
scaler := scalejob. JobPsuedoScaler {
JobsClient : jobsClient ,
}يرجى فتح مشكلة و/أو العلاقات العامة لأي ميزات/أخطاء.
إذا كنت قد استمتعت بـ INFORDYPO ، فقم بإلقاء نظرة على أدوات Anaylsis الأخرى الثابتة!