Skip to content

kristofmulier/fix_include_statements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

fix_include_statements

This script checks a codebase for inconsistencies between the include statements in the files and the actual filenames in the filesystem. These inconsistensies can be a problem on case-sensitive filesystems, such as Linux, and can cause build errors. The script lists all the inconsistencies and allows the user to fix them by choosing the correct filename from the filesystem. The script is intended to be run from the top-level directory of the codebase.

Usage: python fix_include_statements.py [options]

Options:
--------
  -h, --help                                   Show this help message and exit.

  -n, --dry-run                                Print the results without fixing the
                                               include statements.

  -d DIRECTORY,                                Toplevel directory of the codebase
  --directory=DIRECTORY                        to process. If not provided,
                                               the current directory is used.

Examples:
---------
  Show the inconsistencies in the codebase, assuming that this script is in the
  top-level directory:
      > python fix_include_statements.py --dry-run

  Fix the inconsistencies:
      > python fix_include_statements.py

Recently, the script was updated to also fix backslashes in include statements, turning them into forward slashes.

About

Fix include statements in a codebase

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages