snake_case नामों के underscore को hyphen से बदलता है: output_dir → output-dir। लंबे command-line options, URL paths, Kubernetes resource नाम, npm package नाम और CSS classes में hyphen वाले lowercase नाम ही चलन में हैं; convention के अनुसार इनमें से कोई underscore इस्तेमाल नहीं करता।
आम स्थिति है कोई Python script जिसके argparse options या config keys underscore के साथ लिखे गए थे और अब उन्हें पारंपरिक --flag-name रूप चाहिए, या database identifiers जिन्हें URLs में दिखना है।
टेक्स्ट स्ट्रिंग में पेस्ट करें, हर line में एक या एक ही line में।परिणाम का टेक्स्ट कॉपी करें।--dry_run
--output_dir dist
--max_workers 4--dry-run
--output-dir dist
--max-workers 4हर option नाम में hyphen आ जाते हैं, और आगे का -- व वैल्यू dist और 4 बने रहते हैं। argparse में --dry-run अब भी args.dry_run के रूप में पढ़ा जाता है, इसलिए Python की तरफ़ कुछ नहीं बदलता।
max_workers → max-workers, address_line_2 → address-line-2।--, / या ?page=, बना रहता है।_internal_id → internal-id।argparse और click --output_dir स्वीकार करते हैं, लेकिन यूज़र्स --output-dir की अपेक्षा करते हैं। Option सूची बदलकर add_argument calls अपडेट करने से attribute नाम (output_dir) वही रहते हैं।
Table में stored gift_cards या order_history जैसे category codes को /gift-cards और /order-history paths में बदला जा सकता है, जो public URLs के लिए ज़्यादा आम स्टाइल है।
__version__ जैसे आगे double underscore वाले नाम match नहीं होते और अपने underscore रखते हैं।add_argument जैसे function नाम और store_true जैसे keywords भी बदल जाते हैं, जिससे कोड टूट जाता है। सिर्फ़ नाम पेस्ट करें।नहीं। kebab-case options, URLs, फ़ाइल नाम और resource नाम जैसी strings के लिए है; Python variables को snake_case में ही रखें।
Kubernetes नामों में lowercase अक्षर, अंक और hyphen की अनुमति है, और सामान्य snake_case इनपुट से यह ठीक यही बनाता है, अंक वाले segments समेत।