-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    LinuxDaily.com    Linux42.org    OpenSkillz.com   
 
Artwork
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login

-
- News . 
0
votes
click to vote up

Joel Leclerc: extract-xxx – An easy way of extracting XXX/TODO/FIXME’s


Published Apr 27 2013 via RSS

First: The “Why”. Well, it’s because when I write code, I usually don’t have the time (or the patience) to write everything perfectly, so I usually just write in a small TODO or FIXME for later. The issue is, when I do want to fix them (e.g. in the final polishing stage of development), it’s hard to find them (especially if you have many source files, and it takes some time to open any of them). Also, it’s because I wanted to learn perl, and I wanted to take a small break from my other project (which is taking up most of my free time).

The repository is here: https://github.com/MiJyn/extract-xxx. Download it however you want, then run extract-xxx.pl.

What it basically does is that it searches through a file for the “comment types” (which is just a name I assigned for things like “XXX” or “TODO”, since I don’t know that they’re really called), and then prints them with (by default), 2 lines of context, both before and after. It’s kind of like grep, but it’s a bit more specialized towards this task (though you could theoretically do everything this does by fancy utilization of grep, find, and nl).

Example usage:

$ ./extract-xxx.pl -e 'cpp,h'
./src/engine/box.cpp

 51   |  */
 52   | bool Box::uncollide(Box* other, QVector3D old_pos) {
>53>>>|         // XXX: VAR_IS_UNUSED(old_pos)
 54   | 
 55   |         // Broadphase (?)
>56>>>|         // TODO: Check if this actually increases performance
 57   |         if (!this->collides(other)) {
 58   |                 return false;

 61   |                   ds = d + other->size;
 62   |         QVector3D overlap;
>63>>>|         // TODO: Decide the side from `old_pos`
 64   | #define syd_box_ov(x, X) {\
 65   |         qreal x##l_s = syd_max(0, d.x()),\

 79   |  */
 80   | bool Box::render() {
>81>>>|         // TODO: Use Vertex Array Object!
 82   |         qreal ex = size.x() / 2,
 83   |               ey = size.y() / 2,

./src/engine/image.cpp

 66   |         }
 67   |         this->image = image;
>68>>>|         // TODO: Maybe add support for graphics cards that support non-POT images?
 69   |         bool use_mipmaps = this->power_of_two();
 70   |         if (!this->id) {
 71   |                 glGenTextures(1, &this->id);
 72   |         }
>73>>>|         // TODO: Add support for GL_LUMINANCE and GL_LUMINANCE_ALPHA
 74   |         GLint format = this->image.hasAlphaChannel() ? GL_RGBA : GL_RGB;
 75   |         glBindTexture(GL_TEXTURE_2D, this->id);

 78   |                         /* This value must be 0, according to the OpenGL documentation... */ 0,
 79   |                         format, GL_UNSIGNED_BYTE, this->image.bits());
>80>>>|         // TODO: Add support for GL_LINEAR
 81   |         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 82   |         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (use_mipmaps) ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST);

./include/syd/math.h

 23  | }
 24  | 
>25>>| // TODO: Add/use those ultra-optimized-and-hacky functions
 26  | 
 27  | SYD_END_FILE

When run with no arguments, it will recursively go through the current directory (including sub-directories, and sub-sub-directories, etc…), and will then go through each file, as mentioned previously. As you can notice, many lines are highlighted (e.g. >53>>>), as they contain a “comment type” (in this case, either TODO or XXX), proceeded by a colon.

Instead of rewriting everything here, check out the repository, as the README explains pretty much everything you need to know about it.

Anyways, let me know what you think, any constructive criticism is appreciated :)




BackRead original postSend to a friend

Add comment

Add comment
Show all posts




-

-
How do you like Plasma 5?
 The best KDE Desktop ever.
 Definitely a nice improvement.
 Not decided yet. Haven't tried it yet.
 I do not like some of the changes.
 KDE is taking the wrong way.
 I am still sticking with KDE 3.5.
 I have no opinion, but wanted to vote anyway.

resultmore




 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Artwork
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Facebook App
Content RSS   
News RSS   
Discussion RSS   
Events RSS   

Participate
Groups
Forum
Add Artwork
Public API
About KDE-Look.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2001-2014 KDE-Look.org Team  
All rights reserved. KDE-Look.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
KDE and K Desktop Environment are trademarks of KDE e.V.