]> git.donarmstrong.com Git - perltidy.git/blob - TODO
8b0aa0fd57eb74a414805063cb9f1fea3a1fb7d5
[perltidy.git] / TODO
1 Perltidy TODO List
2     This is a partial "wish-list" of features to add and things to do.
3
4   Perltidy not idempotent
5     Perltidy does a single pass but iterates locally to try to satisfy the
6     various constraints and formatting parameters, but in some cases it can
7     take a second pass to reach a stable format, particularly when major
8     format style changes are made. It would be useful to have a flag to
9     force a second pass, say --passes=2.
10
11     For now, a workaround for a single file is
12
13       perltidy file.pl -st | perltidy -o file.tdy
14
15   The starting indentation level is not correctly guessed when tabs are used
16     When formatting a snippet which does not begin at zero indentation,
17     perltidy must guess the starting indentation. The -sil flag can be used
18     to specify this, but this is tedious. In general we cannot know the
19     indentation and can only guess, but we can at least require that if
20     perltidy is run twice on the same snippet, with the same parameters,
21     that the indentation be correctly guessed on the second pass. Currently,
22     this is only true if there are no tabs in the leading whitespace. A
23     patch has been submitted to fix this but it needs a little work still.
24
25   -b does not work through the Tidy module
26     The use of -b in the following does not work:
27
28        use Perl::Tidy ();
29        use File::Spec;
30
31        my $file = File::Spec->catfile( $dir,
32           $filename );
33
34        Perl::Tidy::perltidy(
35           source     => $file,
36           argv        => '-b',
37           perltidyrc => $perltidyrc,
38        );
39
40     A temporary workaround is:
41
42        Perl::Tidy::perltidy(
43           argv        => "-b $file",
44           perltidyrc => $perltidyrc,
45        );
46
47   Improved Vertical Alignment
48     There are still many opportunities for improving vertical alignment.
49
50   Documentation
51     A FAQ is needed to explain some of the more subtle formatting issues,
52     and to give examples of different styles.
53
54     The -formatter callback object documentation is incomplete.
55
56   HTML writer
57     The HTML writer does not colorize interpolated identifiers in here
58     documents or quoted strings. The tokenizer outputs interpolation
59     information for here docs; it still needs to be updated to do this for
60     multi-line quotes. Then code needs to be written to scan for and markup
61     identifiers.
62
63 Things which have been suggested but will not be done
64   Recursive file processing
65     A -r flag might be nice, but this is best handled by an exterior shell
66     script.
67