Arkweid
(Abroskin Alexander)
2 يوليو 2019، 9:46م
1
مرحبًا يا أصدقاء. تم دمج Lefthook في بيئة التطوير. أنا المؤلف، لذا يمكنني المساعدة في أي سؤال يتعلق به. إذا واجه أي شخص مشكلة أو يرغب في إضافة ميزة، فأخبرني
pfaffman
(Jay Pfaffman)
2 يوليو 2019، 9:58م
2
مرحبًا، @Arkweid ! هل يمكنك التحدث أكثر عن ماهية Lefthook ولماذا نرغب في معرفة المزيد عنه؟ ربما رابط عنه وحالة استخدام؟
Falco
(Falco)
2 يوليو 2019، 10:20م
3
لقد استخدمته لأول مرة اليوم، ومن الرائع أنني لم أضطر إلى إجراء أي إعداد على جهاز الكمبيوتر الخاص بي من أجله.
شكرًا لك على طلب السحب!
هناك سياق هنا:
master ← Arkweid:replace-overcommit-with-lefthook
merged 09:29AM - 02 Jul 19 UTC
Overcommit uses prebuilt hooks and require global installation.
To avoid this i… ssues replace it with [Lefthook](https://github.com/Arkweid/lefthook).
Lefthook will be installed with npm packages. New contributors
will have fully consistent git hooks.
Goals:
- **Strict workflow**. Avoid situations when newcomers pushed PR without checks with rubocop or eslint. And members should [recommend](https://github.com/discourse/discourse/pull/7192#issuecomment-473973502) to install overcommit.
- **Flexibility**. You free to combine basic operations.
- **Сlarification**. Overcommit provide prebuilt hooks. So its hard to understend what is going on without inspecting overcommit repository.
- **20% Faster**. Well, it not a big issue in development environment, but a like faster instruments :)
- **Twice speed up for CI lints**. With Lefthook we can run lints on CI in paralel mode. You can check [example here](https://travis-ci.org/discourse/discourse/jobs/551862476#L956).
Example output for this commit:

Example output for CI lints:

Don't forget to remove preinstalled hooks from you repo `overcommit --uninstall` if you want to test it action.
So what do you think about. Is it worth?
Arkweid
(Abroskin Alexander)
2 يوليو 2019، 11:00م
4
هنا مستودع.
Lefthook هو مدير خطافات Git. مكتوب بلغة Go، لذا فهو مجرد ملف تنفيذي واحد بدون تبعيات، ويمكنك استخدامه في أي نوع من المشاريع (Rust، Erlang، Java، أو أي شيء آخر تريده).
ميزات إضافية قد تهمك في سياق Discourse:
تشغيل ملفات السكريبت - يمكن لـ Lefthook تشغيل أوامر ليست فقط في سطر واحد. هنا مثال على كيفية التحقق من رأس الالتزام (commit header) ورفضه إذا لم يتطابق النمط. لا مزيد من التزامات “fix bug”!
التكامل مع crystalball - من الجيد دائمًا تشغيل اختبارات rspec فقط للكود المتغير. الأمر سهل مع Lefthook.
Arkweid
(Abroskin Alexander)
10 يوليو 2019، 4:15م
5
دليل حول استخدام Lefthook + Crystallball .
إذا كنت قد سئمت من انتظار rspec لمدة 10 دقائق وتريد تشغيل الاختبارات الفعلية للكود المُعدّل