[Melbourne-pm] RFC - tidyview-1.01 posted to sourceforge.

leif.eriksen at hpa.com.au leif.eriksen at hpa.com.au
Fri Aug 4 02:27:37 PDT 2006


Having trouble configuring your perltidy options ? Not sure of the
effects of one option over another ?
 
Well after much work I am pleased to announce that
 
Tidyview-1.01
http://sourceforge.net/project/showfiles.php?group_id=168694
<http://sourceforge.net/project/showfiles.php?group_id=168694>  
 
is available for testing and comment.
 
Tidyview is a graphical previewer, for evaluating the effect of perltidy
options on your code. Select the options you think you'd like, press the
"Run with these options" button, and see the effect on your code right
in front of you.
 
Perltidy is a pretty-printer for perl, and has been around since 2001.
 
Tidyview was first born out of a conversation after OSDC 2005, when Perl
Best Practices was being discussed, but I started playing with the
concept over 5 years ago. I just figured someone had already done it.
 
Tidyview initially displays your code (or itself, if you dont provide a
filename argument) tidy'ed with perltidy's defaults. It can read any
perltidy config file you'd like to use, and you can save the perltidy
config that results from your option choices when your happy.
 
Note that this is a Perl-based application ( and Perl/Tk at that), so if
you'd like to play with it before installing, just cd to the 'bin'
directory and run the perlenv.bash helper script (assuming your using a
platform that bash makes sense on) to manipulate your PERL5LIB path - I
dislike "use lib ()" fiddles. Then run tidyview itself.
 
tidyview has dependencies on 
Log::Log4perl - I'm planning to remove this dependency once the app has
some maturity.
Tk
perltidy - and a recent one at that. After a 3 year hiatus, two new
releases have recently appeared. tidyview relies on the new Perl::Tidy
API.
 
Note that it should work with most versions of Tk. Really ancient ones
may be a problem. I've tried to use only core Tk widgets, but if you
want a specialised one, I'm open to suggestions.
 
Please send me any feedback, bugs, comments, suggestions, annoyances. I
plan to post the app to CPAN once initial early release problems are
addressed.
 
Tidyview follows the typical perl app/module style, so the recipe to
start playing is :-
 
tar zxvf tidyview-1.01.tar.gz
cd tidyview-1.01
perl Makefile && make test
cd bin
source perlenv.bash
perl tidyview.pl <path to your perl source file>
 
POD is available via "perldoc tidyview.pl"
 
Basic options are
 
--log <log config file> - really only for debugging
--help
--man
--version
 
Note that there is currently an error in the processing of perltidy
config file recommended in Perl Best Practices, and tidyview will
complain - or rather, it passes on perltidy's complaint. Delete the -se
and -st options from Damian's sample, and all will be well. -st says
echo to STDOUT, -se says echo to STDERR, and perltidy complains it cant
do both. I make no judgements as to the correctness of the complaint,
I'm just telling you what it does.
 
Interestingly the developer of perltidy has been using tidyview's
early-alpha releases to debug perltidy itself, and he openned up
perltidy's internals with an API, meaning most of tidyview is not
hardcoded to emulate perltidy, but asks questions of, and receives
answers from perltidy itself.
 
Some people have told me that they suspect that perltidy may change the
semantics of the perl code it tidies, but the developer of perltidy
assures me this is highly unlikely, and no one has ever complained of
tidy'd code being broken in the process of tidying in the 6 years he's
been supporting it. However, if there's enough demand, I can introduce
support for Perl::Signature, but at this stage I dont see the need.
Prove me wrong !
 
So good luck and good tidy'ing !!!

Leif Eriksen

Research and Development Engineer

HPA

Direct: +61 3 9217 5545

www.hpa.com.au <file://C:\Documents and Settings\le6303\Application
Data\Microsoft\Signatures\Default.htm> 

 

 


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.5/407 - Release Date:
3/08/2006


**********************************************************************
IMPORTANT
The contents of this e-mail and its attachments are confidential and intended
solely for the use of the individual or entity to whom they are addressed.  If
you received this e-mail in error, please notify the HPA Postmaster, postmaster at hpa.com.au,
then delete  the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For more
information about use, disclosure and access see our Privacy Policy at
www.hpa.com.au
**********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20060804/d5936aee/attachment.html 


More information about the Melbourne-pm mailing list