2 # this is in pod format (try `perldoc HACKING.pod`)
8 HACKING.pod - contributing to TAP::Harness
12 This is the guide for TAP::Harness internals contributors (developers,
13 testers, documenters.)
15 If you are looking for more information on how to I<use> TAP::Harness,
17 L<http://testanything.org/wiki/index.php/TAP::Parser_Cookbook> instead.
19 =head1 Getting Started
21 See the resources section in I<META.yml> or I<Build.PL> for links to the
22 project mailing list, bug tracker, svn repository, etc.
24 For ease of reference, at the time of writing the SVN repository was at:
26 http://svn.hexten.net/tapx
28 To get the latest version of trunk:
30 svn co http://svn.hexten.net/tapx/trunk
32 For best results, read the rest of this file, check RT for bugs which
33 scratch your itch, join the mailing list, etc.
39 The project comes with a C<.perltidyrc>, which perltidy will
40 automatically use if the project root is your working directory. This
41 is setup by default to read and write the perl code on a pipe. To
42 configure your editor:
48 In C<.vimrc>, you can add the following lines:
50 nnoremap <Leader>pt :%!perltidy -q<cr> " only work in 'normal' mode
51 vnoremap <Leader>pt :!perltidy -q<cr> " only work in 'visual' mode
53 In other words, if your C<Leader> is a backslash, you can type C<\pt> to
54 reformat the file using the C<.perltidyrc>. If you are in visual mode
55 (selecting lines with shift-v), then only the code you have currently have
56 selected will be reformattted.
60 For emacs, you can use this snippet from Sam Tregar
61 (L<http://use.perl.org/~samtregar/journal/30185>):
63 (defun perltidy-region ()
64 "Run perltidy on the current region."
67 (shell-command-on-region (point) (mark) "perltidy -q" nil t)
70 (defun perltidy-all ()
71 "Run perltidy on the current region."
75 (shell-command-on-region (point-min) (point-max) "perltidy -q" nil t)
80 (global-set-key "\M-t" `perltidy-region)
81 (global-set-key "\M-T" `perltidy-all)
85 =head1 Tests and Coverage
90 TODO link to a good guide on writing tests for TAP::Parser
92 =head1 Writing for Compatibility
97 TODO explain no bundling, PERL_CORE, etc
99 =head1 Use TAP::Object
101 TAP::Object is the common base class to all TAP::* modules, and should be for
104 =head1 Exception Handling
106 Exceptions should be raised with L<Carp>:
109 Carp::croak("Unsupported syntax version: $version");
112 Carp::confess("Unsupported syntax version: $version");
114 =head1 Deprecation cycle
116 Any I<documented> sub that needs to be changed or removed (and would therefore
117 cause a backwards-compat issue) must go through a deprecation cycle to give
118 developers a chance to adjust:
120 1. Document the deprecation
127 The end-user and API documentation is all in the 'lib/' directory. In
128 .pm files, the pod is "inline" to the code. See L<perlpod> for more
133 For compatibility's sake, we do not use the =head3 and =head4 commands.
137 =item C<=head1 SECTION>
139 Sections begin with an C<=head1> command and are all-caps.
142 I guess... Mixed case messes with various pod hacking tools.
150 SOME OTHER SORT OF METHODS
153 =item C<=head2 method>
156 The following is how I would do it, but opposite of what we have.
158 The C<=head2> command documents a method. The name of the method should have no adornment (e.g. don't CE<lt>method> or CE<lt>method($list, $of, $params)>.)
160 These sections should begin with a short description of what the method
161 does, followed by one or more examples of usage. If needed, elaborate
162 on the subtleties of the parameters and context after (and/or between)
167 This method does some blah blah blah.
169 my @answer = $thing->this_method(@arguments);
173 Returns true if the thing is true.
175 if($thing->that_thing) {
179 =item C<=item parameter>
181 Use C<=item> commands for method arguments and parameters (and etc.) In
182 most html pod formatters, these I<do not> get added to the
183 table-of-contents at the top of the page.
187 =head2 Pod Formatting Codes
191 =item LE<lt>Some::Module>
193 Be careful of the wording of C<LE<lt>Some::ModuleE<gt>>. Older pod
194 formatters would render this as "the Some::Module manpage", so it is
195 best to either word your links as "C<(see E<lt>Some::ModuleE<gt> for
196 details.)>" or use the "explicit rendering" form of
197 "C<E<lt>Some::Module|Some::ModuleE<gt>>".
203 The version numbers are updated by L<Perl::Version>.
205 =head2 DEVELOPER DOCS/NOTES
207 The following "formats" are used with C<=begin>/C<=end> and C<=for>
208 commands for pod which is not part of the public end-user/API
215 Use this if you are uncertain about a change to some pod or think it
223 This is either falsely documented or a bug -- see ...
229 Long-winded explanation of why some code is the way it is or various
230 other subtleties which might incite head-scratching and WTF'ing.
237 removed in 0.09, kill by ~0.25
241 =head1 Committing to Subversion
243 If you have commit access, please bear this in mind.
245 Development is done either on trunk or a branch, as appropriate:
247 If it's something that might be controversial, break the build or take a long
248 time (more than a couple of weeks) to complete then it'd probably be
249 appropriate to branch. Otherwise it can go in trunk.
251 If in doubt discuss it on the mailing list before you commit.
256 ... or whatever. I'm just making stuff up here. If any of this is
257 wrong, please correct it. To the extent that there is an "official
258 policy", it should be written down. --Eric
262 # vim:ts=2:sw=2:et:sta