<commit_before># Test Changes

Test files that have changed since a given commit.

[![Status](https://travis-ci.org/gsmendoza/test_changes.svg?branch=master)](https://travis-ci.org/gsmendoza/test_changes "See test builds")

## Requirements

* [Git](https://git-scm.com)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'test_changes', require: false
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install test_changes

## Configuration

Add a `.test-changes.yml` configuration file to your repo. Example:

```yaml
---
rspec:
  finding_patterns:
    ^lib/(.+)\.rb: spec/\1_spec.rb
    ^spec/(.+)_spec.rb: spec/\1_spec.rb
  exclude:
    - spec/fixtures/**/*
rubocop:
  finding_patterns:
    ^(.+)\.rb: \1.rb
```

At the root of the file, we have the commands for running the tests. Examples: `rspec`, `zeus rspec`, `rubocop`.

These are the options under each command:

* finding_patterns - If the name of a changed file matches
  the regular expression, `test_changes` will test the file's matching tests.
  Can accept an array of tests:

    ```yaml
    rspec:
      finding_patterns:
        ^lib/test_changes\.rb:
        - spec/test_changes_spec.rb
        - spec/test_changes/*_spec.rb
    ```

  The values can also be glob patterns.

* exclude - Patterns of files that should be excluded from the run.

## Usage

`test-changes -c [commit] -- [test_tool_arguments]`

* `test_tool_arguments` - Arguments that can be passed to the test tool.

* `commit` - Test change from this commit. Defaults to HEAD.

See `test-changes -h` for more options.

Examples:

```
test-changes
test-changes -c master
test-changes -c HEAD^ -- --format=documentation
```

## Known to work on

* Ruby 2.0.0
* Git 2.3.5

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.<commit_msg>Update README.<commit_after># Test Changes

Test files that have changed since a given commit.

[![Status](https://travis-ci.org/gsmendoza/test_changes.svg?branch=master)](https://travis-ci.org/gsmendoza/test_changes "See test builds")

## Requirements

* [Git](https://git-scm.com)

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'test_changes', require: false
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install test_changes

## Configuration

Add a `.test-changes.yml` configuration file to your repo. Example:

```yaml
---
rspec:
  finding_patterns:
    ^lib/(.+)\.rb: spec/\1_spec.rb
    ^spec/(.+)_spec.rb: spec/\1_spec.rb
  exclude:
    - spec/fixtures/**/*
rubocop:
  finding_patterns:
    ^(.+)\.rb: \1.rb
```

At the root of the file, we have the commands for running the tests. Examples: `rspec`, `zeus rspec`, `rubocop`.

These are the options under each command:

* `finding_patterns` - If the name of a changed file matches
  the regular expression, `test_changes` will test the file's matching tests.
  Can accept an array of tests:

    ```yaml
    rspec:
      finding_patterns:
        ^lib/test_changes\.rb:
        - spec/test_changes_spec.rb
        - spec/test_changes/*_spec.rb
    ```

    The values can also be glob patterns.

* `exclude` - Patterns of files that should be excluded from the run.

## Usage

`test-changes -c [commit] -- [test_tool_arguments]`

* `test_tool_arguments` - Arguments that can be passed to the test tool.

* `commit` - Test change from this commit. Defaults to HEAD.

See `test-changes -h` for more options.

Examples:

```
test-changes
test-changes -c master
test-changes -r rspec -c HEAD^ -- --format=documentation
```

## Known to work on

* Ruby 2.0.0
* Git 2.3.5

## Development

After checking out the repo, run `bundle install` to install dependencies. Then, run `bundle console` for an interactive prompt that will allow you to experiment.
{'fraction_non_alphanumeric': 0.12307692307692308, 'fraction_numerical': 0.004615384615384616, 'mean_word_length': 3.3635346756152127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4451053', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1243, 'n_words': 428}