Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Edge-Friend: Fast and Deterministic Catmull-Clark Subdivision Surfaces
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Real-Time Procedural Generation with GPU Work Graphs
    • Scalable rendering for very large meshes
    • Spatiotemporal Variance-Guided Filtering for Motion Blur
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
    • Towards Practical Meshlet Compression
  • About
  • Archive

Automatic consistency checking

May 24, 2007
  • Programming
approximately 4 minutes to read

Yesterday evening I slapped together a small tool for consistency checking of large codebases. It’s written in a similar spirit as Boost’s inspect tool, just slightly more sophisticated. Written in C#, it allows you to plug in your own checks easily. At the moment, I have a generic RegEx checker (just looks if a regular expression matches) and a line ending checker in my core tests and a bunch of niven specific ones (license, interfaces with struct and not with class, file header, @file comment in header matches file name, include guards are not reused, missing @author, outdated mail addresses). Some example output:

Loading checker from 'Checks'
         .. 'CrLfCheck'
 .. 1 checker loaded
Loading checker from 'nivenChecks'
         .. 'CheckFileHeader'
         .. 'OutdatedMailAnteru'
         .. 'AuthorCheck'
         .. 'IncludeGuards'
         .. 'StructInterfaces'
         .. 'FilenameInHeader'
 .. 6 checker loaded

Extensions:
        'cpp'
        'h'

Running checks for 'archive.h'
 ++ OK  ... 0 failures

...

Running checks for 'core.h'
    Include guards      : Include guard already used
        >> Line: 9: The include guard 'NIV_CORE_H' has been already used
    Interfaces          : Interface defined with 'class'
        >> Line: 17: Interface 'IFileSystem' uses 'class' instead of 'struct'
 -- FAILED  ... 2 failures

...

39 failures (101 files total)

It was written against the .NET Framework 2.0, but it should work with Mono as well. On startup, it loads up your assembly and pulls the checks out of it, so it’s really easy to extend. I’m running it now along with the build to see which files need some attention. By the way, anonymous comments are enabled, so you can tell me what features would you like to see from such a litte helper?

Previous post
Next post

Recent posts

  • Data formats: Why CSV and JSON aren't the best
    Posted on 2024-12-29
  • Replacing cron with systemd-timers
    Posted on 2024-04-21
  • Open Source Maintenance
    Posted on 2024-04-02
  • Angular, Caddy, Gunicorn and Django
    Posted on 2023-10-21
  • Effective meetings
    Posted on 2022-09-12
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

Anteru NIV_Anteru
Contents © 2005-2025
Anteru
Imprint/Impressum
Privacy policy/Datenschutz
Made with Liara
Last updated February 03, 2019