SwiftDocautomator هي أداة قوية تقوم تلقائيًا بإنشاء تعليقات الوثائق على الرمز السريع الخاص بك ، باتباع إرشادات Apple و Swift الرسمية. يساعدك ذلك على توفير الوقت والجهد من خلال تحليل الكود وإنتاج وثائق موجزة وسهلة الفهم.
لتثبيت SwiftDocautomator ، ما عليك سوى استنساخ المستودع وتثبيت التبعيات المطلوبة:
git clone https://github.com/Saik0s/SwiftDocAutomator.git
cd SwiftDocAutomator
pip install -r requirements.txtلاستخدام SwiftDocautomator ، قم بتشغيل الأمر التالي:
python main.py /path/to/your/swift/file.swiftسيؤدي ذلك إلى إنشاء تعليقات وثائق لجميع الوظائف والخصائص في الملف السريع المحدد ، باتباع إرشادات Apple و Swift الرسمية.
لنفترض أن لديك وظيفة Swift التالية:
internal static func _typeMismatch ( at path : [ CodingKey ] , expectation : Any . Type , reality : Any ) -> DecodingError {
let description = " Expected to decode ( expectation ) but found ( _typeDescription ( of : reality ) ) instead. "
return . typeMismatch ( expectation , Context ( codingPath : path , debugDescription : description ) )
}ستقوم SwiftDocautomator بإنشاء تعليق الوثائق التالية:
/// Returns a `.typeMismatch` error describing the expected type.
///
/// - parameter path: The path of `CodingKey`s taken to decode a value of this type.
/// - parameter expectation: The type expected to be encountered.
/// - parameter reality: The value that was encountered instead of the expected type.
/// - returns: A `DecodingError` with the appropriate path and debug description. يسعدني تلقي أي مساهمات قد تكون لديك. إذا كان لديك أي اقتراحات أو تقارير الأخطاء أو طلبات الميزات ، فلا تتردد في فتح مشكلة على مستودع GitHub. ملاحظاتك ذات قيمة بالنسبة لي وأقدر أي مدخلات يمكنك تقديمها.
يتم إصدار SwiftDocautomator بموجب ترخيص MIT. انظر ملف الترخيص لمزيد من المعلومات.