Indent Finder determines indentation used in source files or trees.
One common problem programmers face is inconsistent indentation of external sources. Some use two spaces, some use four spaces, and some even mix tab and spaces. While text editors have options to help deal with indentation, they only work well with files that have been indented in the same way as your own. If editing an external source with a different indentation, your editor settings can easily mess up the file without you realizing it.
Indent Finder solves this problem by scanning each line of the entry file to find the indentation being used. It ignores blank lines and mixed indentation lines and takes note of the number of lines with a specific indentation, including tab and spaces with 2-8 spaces between them.
At the end of the scan phase, the software determines the indentation used with the highest number of lines. In the case of spaces, it chooses the highest indentation number that reports at least 10% more lines with this indentation. The step of each indentation increase is also considered a strong hint of the current indentation of the file, and a bonus is given to the number of spaces used.
Usage of Indent Finder is easy in command line mode, producing output like "space 4" or "tab 8". It can be used in other programs or shell scripts, and even allows you to check your source tree for inconsistent indentation. Requirements for the software are minimal, with Python being the only necessary component.
Version 1.31: N/A