如何将perltidy配置为格式化if if语句如下:
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"; }
编辑1: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
解决方法
原文地址:https://www.jb51.cc/Perl/241725.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。