Leif Eriksen > tidyview > tidyview

Download:
tidyview-1.14.tar.gz

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

tidyview - a previewer for the effects of perltidy's plethora of options

SYNOPSIS ^

  tidyview
  tidyview [--log <log4perl config file>] [<perl code file>]

DESCRIPTION ^

tidyview is a Tk-based GUI that assists with selecting options for use with perltidy, a source code reformatter and indenter for Perl.

As good as perltidy is, it suffers a little from the huge number of options it supports - so whilst it is possible to find a set of options to layout the code exactly how you want, finding that set of options can be quite time consuming, requiring lots of back-to-back comparisons to find the effect your looking for. And thats where tidyview can help.

tidyview allows you to see the effect of perltidy options side-by-side with your original code. All of perltidy's options that affect code layout (rather than the operation of perltidy itself) are able to be selected, with Tk widgets that constrain them to valid values where possible.

Additionally, once your happy with the selected options, tidyview allows you to generate the selected options as a .perltidyrc configuration file, for further use.

OPTION CATEGORY ^

Within the tidyview application, the perltidy options are grouped into broad categories, in a drop-down list titled "Formatting Section". These formatting sections match the sections in the perltidy documention, being

Basic Formatting Options
Code Indentation Control
Whitespace Control
Comment Controls
Linebreak Controls
Controlling list formatting
Retaining or ignoring existing line breaks
Blank line Control
Styles
Other Controls
HTML options
pod2html options

Each of these sections presents a set of options to the user, generally

A set of checkbox style options
A set of integer-based options, either as a spinbox or a textbox, depending on your version of Tk
A set of text-based options - note, at the moment, no validation of what you enter is done, perltidy and not tidyview will complain.
A set of list-based options, as a scrolling listbox
A set of colour dialogues, for things like POD colour options

Note that not all option sections will display all these sets, as not all section have options that need these sets - for example in the HTML options section, the only set displayed is the checkbox set, as perltidy does not support any other option sets.

TODO ^

perltidy is a very young application, so there are many ways it can be improved. Some of these include

The ability to read an existing .perltidyrc
The ability to check that the parse tree has not been altered by the reformatting and indentation. This is planned to be support through PPI::Signature
Support for displaying the before and after formatting as a colourised diff
Support for generating CVS/Subversion/<insert favourite version management here> pre/post-commit hooks
Reorganise really long option lists so that things dont get pushed off the screen.
everyones favouriites - more doco and tests

AUTHORS

Leif Eriksen <tidyview@sourceforge.net>

syntax highlighting: