Skip to content

shopyourway/file-content-linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

File Content Linter

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.

Highlights

  • Command line interface
  • Built with Perl
  • TeamCity support using script interaction

Getting started

Prerequisite

Perl is required in order to run File Content Linter.

Follow installation instructions here to install it.

Usage

perl find-in-files.pl --path="<PATH TO TARGET DIRECTORY>"; --term="<REGEX TO SEARCH FOR>" [--exclude="<REGEX TO EXCLUDE FILES>"] [--output="<LOCAL|TEAMCITY>"]
path (required)

Path to the directory to scan

term (required)

Regex describing what to look for

exclude (optional)

Regex describing what to look for

output (optional)

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

Example

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.

Development

How to contribute

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

About

Validation of file content for Continuous Integration

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages