diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-03-09 21:48:51 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-03-09 21:48:51 -0300 |
| commit | c642042536362bba0d3ee0ebf6a6c33a888a0ff5 (patch) | |
| tree | e2684a2758190ab67483156876e35824fc76e708 /todos.pl | |
| parent | cce3bfba31b32c13ea116a214306d96fe1eb27eb (diff) | |
| download | Sakura-c642042536362bba0d3ee0ebf6a6c33a888a0ff5.tar.gz Sakura-c642042536362bba0d3ee0ebf6a6c33a888a0ff5.zip | |
defenestrate json
Diffstat (limited to 'todos.pl')
| -rw-r--r-- | todos.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/todos.pl b/todos.pl new file mode 100644 index 0000000..c1c6368 --- /dev/null +++ b/todos.pl @@ -0,0 +1,31 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use File::Find; + +my $root = $ARGV[0] // '.'; +my @files; + +find(sub { + $File::Find::prune = 1 if -d && /^(_build|\.git)$/; + push @files, $File::Find::name if /\.ml(i|l)?$/ && -f; +}, $root); + +my $count = 0; +for my $file (sort @files) { + open my $fh, '<', $file or die "Cannot open $file: $!"; + my $lineno = 0; + while (<$fh>) { + $lineno++; + if (/\bTODO\b[:\s]*(.*)/) { + my $msg = $1; + $msg =~ s/\s*\*\)\s*$//; # strip OCaml comment close + $msg =~ s/^\s+|\s+$//g; + printf "%-60s line %-4d %s\n", $file, $lineno, $msg; + $count++; + } + } + close $fh; +} + +print "\n$count TODO(s) found.\n"; |
