nasıl uzun biçimlendirmek için perltidy yapılandırabilirsiniz eğer böyle ifadeler:perltidy biçimlendirme kompleksi eğer
if (
('this is an example' =~ /an.*example/ and 1 * 2 * 3 == 6) or
('hello world' =~ /world/ and 6 = 3 * 2 * 1)
) {
print "hello\n";
}
veya bu
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 gibi:
--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
perltidyrc
Düzenleme 2: İlk (
ve son )
'dan sonra {
ile yeni bir satırın olması için yeni bir satıra sahip olmaktır. Bu mümkün değilse, daha iyi biçimlendirme için diğer öneriler takdir edilecektir.
Eğer ifade çok satırlı ise dış parantez öncesi/sonrası boşluk eklemenin bir yolu var mı? (p.s. Onları içine kaldırdığım perltidyrc ekledim) – bliof
@bliof, hayır, stil blokları için seçenekler oldukça sınırlıdır. – titanofold