मैं perltidy कैसे कॉन्फ़िगर लंबे फ़ॉर्मेट करने के लिए कर सकते हैं अगर इस तरह के बयानों:perltidy स्वरूपण जटिल अगर
if (
('this is an example' =~ /an.*example/ and 1 * 2 * 3 == 6) or
('hello world' =~ /world/ and 6 = 3 * 2 * 1)
) {
print "hello\n";
}
या इस
if (
('this is an example' =~ /an.*example/ and 1 * 2 * 3 == 6)
or ('hello world' =~ /world/ and 6 == 3 * 2 * 1)
) {
print "hello\n";
}
Edit1 की तरह: perltidyrc
--maximum-line-length=100
--indent-columns=4
--default-tabsize=4
--continuation-indentation=4
--closing-token-indentation=0
--no-indent-closing-brace
--paren-tightness=2
--square-bracket-tightness=2
--block-brace-tightness=0
--trim-qw
--nospace-terminal-semicolon
--nospace-for-semicolon
--indent-spaced-block-comments
--ignore-side-comment-lengths
--cuddled-else
--no-opening-brace-on-new-line
--no-opening-sub-brace-on-new-line
--no-opening-anonymous-sub-brace-on-new-line
--no-brace-left-and-indent
--blanks-before-comments
--blank-lines-before-subs=1
--blanks-before-blocks
--maximum-consecutive-blank-lines=1
संपादित 2: विचार (
के बाद एक नई पंक्ति है और {
के साथ एक नई लाइन पर होने के लिए अंतिम )
भी है। यदि यह संभव नहीं है, तो बेहतर स्वरूपण के लिए किसी भी अन्य सुझाव की सराहना की जाएगी।
अगर कथन मल्टीलाइन है तो बाहरी ब्रैकेट के पहले/बाद में रिक्त स्थान जोड़ने का कोई तरीका है? (पी। मैंने अपने perltidyrc को जोड़ा है जिसमें मैं उन्हें हटा देता हूं) – bliof
@bliof, नहीं, स्टाइल ब्लॉक के विकल्प काफी सीमित हैं। – titanofold