يحتوي مستودع discourse على إعدادات لـ lefthook. سيقوم هذا بالتحقق تلقائيًا من أي رمز قبل أن يتم تثبيته في git، وتنبيهك بشأن أي مشكلات. للإعداد، ما عليك سوى الدخول إلى دليل تطوير discourse الخاص بك وتشغيل
pnpm install
pnpm run lefthook install
سيتم الآن فحص الملفات تلقائيًا قبل الالتزام. إذا كانت هناك أية مشكلات، فسيتم إلغاء الالتزام، وسيتم عرض قائمة بالأخطاء لك.
يتم التحكم في إصدار هذا المستند - اقترح تغييرات على github.
حاليًا أحصل على نسخة من هذا الخطأ مع النسخة الرئيسية الحالية في WSL2
لقد أفسد قدرتي على الالتزام:
robert@blah:~/discourse$ git commit -m "fix test setup"
/home/robert/discourse/node_modules/lefthook-linux-x64/bin/lefthook: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/robert/discourse/node_modules/lefthook-linux-x64/bin/lefthook)
/home/robert/discourse/node_modules/lefthook-linux-x64/bin/lefthook: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/robert/discourse/node_modules/lefthook-linux-x64/bin/lefthook)
أي أفكار؟
يبدو أنه كان هناك تحديث من dependabot لـ lefthook قبل 8 ساعات فقط.
قد أضطر إلى تعديل package.json الخاص بي إلى الوراء قليلاً؟
وفقًا لمشكلة GitHub الخاصة بهم، فإن الاعتماد على المكتبات المشتركة ليس مقصودًا. حتى لو تمكنت من جعله يعمل، فمن المحتمل أن يواجه الآخرون مشاكل. لذا ها نحن ذا:
robert@blah:~/discourse$ yarn list --pattern lefthook
yarn list v1.22.19
warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"
├─ lefthook-darwin-arm64@1.7.7
├─ lefthook-darwin-x64@1.7.7
├─ lefthook-freebsd-arm64@1.7.7
├─ lefthook-freebsd-x64@1.7.7
├─ lefthook-linux-arm64@1.7.7
├─ lefthook-linux-x64@1.7.7
├─ lefthook-windows-arm64@1.7.7
├─ lefthook-windows-x64@1.7.7
└─ lefthook@1.7.7
Done in 0.53s
robert@blah:~/discourse$ git status
On branch test_branch
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: mytestfile
robert@blah:~/discourse$ git commit -m "test file addition"
│ ember-template-lint (skip) no files for inspection
│ yaml-syntax (skip) no files for inspection
│ i18n-lint (skip) no files for inspection
│ rubocop (skip) no files for inspection
│ eslint (skip) no files for inspection
│ prettier (skip) no files for inspection
│ prettier-scss (skip) no files for inspection
│ syntax_tree (skip) no files for inspection
────────────────────────────────────
summary: (done in 0.06 seconds)
[test_branch 1cd0bb3839] test file addition
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 mytestfile