Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d4fb507e
Commit
d4fb507e
authored
Feb 15, 2007
by
Dries Buytaert
Browse files
- Patch
#118891
by tanifa: added PerlDoc comments / user generated documentation. Tres cool.
parent
1346fbb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/code-style.pl
View file @
d4fb507e
#!/usr/bin/perl -w
# $Id$
# Author: Alexander Schwartz (alexander.schwartz@gmx.net)
# Licence: GPL
# First version: 2001-10-15
use
Pod::
Usage
;
use
Getopt::
Long
qw(GetOptions)
;
Getopt::Long::
Configure
("
bundling
");
# Originally written for Drupal (http://drupal.org/) to ensure stylish
# code. This program tries to show as many improvements as possible with
# no false positives.
my
%opt
=
(
"
help
"
=>
0
,
'
debug
'
=>
0
,
);
# $Id$
$comment
=
0
;
$program
=
0
;
if
(
$ARGV
[
0
]
eq
'
-debug
')
{
$debug
=
1
;
shift
(
@ARGV
);
}
else
{
$debug
=
0
;
if
(
!
GetOptions
(
\
%opt
,
'
help|?
',
'
debug
',
))
{
pod2usage
(
-
exitval
=>
1
,
'
verbose
'
=>
0
);
}
pod2usage
(
-
exitval
=>
0
,
-
verbose
=>
2
)
if
(
$opt
{'
help
'});
$debug
=
$opt
{'
debug
'};
$comment
=
0
;
#flag used to signal we're inside /* */
$program
=
0
;
#flag used to signal we're inside <?php ?>
#read the file
while
(
<>
)
{
$org
=
$_
;
s/\\["']//g
;
...
...
@@ -160,3 +163,33 @@ while (<>) {
}
continue
{
close
ARGV
if
eof
;
}
__END__
=head1 NAME
code-style.pl - Review drupal code for style
=head1 SYNOPSIS
code-style.pl [options] <filename>
Options:
-? --help detailed help message
=head1 DESCRIPTION
Originally written for Drupal (http://drupal.org/) to ensure stylish
code. This program reviews PHP code, and tries to show as many code
improvements as possible with no false positives.
=head1 OPTIONS
--comment
=head1 EXAMPLES
./code-style.pl ../index.php
=cut
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment