File content linter is a utility, aimed for Continuous Integration, for validating that important information does not appear in text files in a given directory.
Our main usage of it is to make sure code we publish to Open Source does not include internal stuff, like credentails or server names.
- Command line interface
- Built with Perl
- TeamCity support using script interaction
Perl is required in order to run File Content Linter.
Follow installation instructions here to install it.
perl find-in-files.pl --path="<PATH TO TARGET DIRECTORY>"; --term="<REGEX TO SEARCH FOR>" [--exclude="<REGEX TO EXCLUDE FILES>"] [--output="<LOCAL|TEAMCITY>"]
Path to the directory to scan
Regex describing what to look for
Regex describing what to look for
Output type for matches.
LOCAL (default): for local machine run. Output will be FILENAME:LINENUMBER:MATCH:LINE
TEAMCITY: for output that allows integration with TeamCity
perl ./find-in-files.pl --path="~/dev/myproject/" --term="password" --exclude="\.crt$" --output="TEAMCITY"
This command will scan all the files under ~/dev/myproject/
except files with crt extension for the word password, each match will create an output that TeamCity will recognize as failed test.
We encorage contribution via pull requests on any feature you see fit.
When submitting a pull request make sure to do the following:
- Check that new and updated code follows OhioBox existing code formatting and naming standard
- Run all unit and integration tests to ensure no existing functionality has been affected
- Write unit or integration tests to test your changes. All features and fixed bugs must have tests to verify they work Read GitHub Help for more details about creating pull requests