Skip to content

Exclude specified paths from mutants generation #58

@dmoka

Description

@dmoka

I believe that it would be handy to exclude specified paths from the mutants generation.

Let's say that I want to exclude things like configuration logic or some test helper logic files, located within the src directory. Right now the default behaviour of cargo mutants command is that it tries to generate mutants for every file in the src directory and in their child directories.

I could envision having a command line parameter as follows:

cargo mutants --exclude <regexes-for-paths-to-be-excluded>

Use case scenario:

Prerequisite:

Git clone test repo

Steps:

  1. Go to the main directory of the cloned repo
  2. Execute the following command
cargo mutants --exclude "(\/src\/tests)" "(\/src\/config)"

Expected behaviour:

Every file which is located in either /src/tests or /src/config directories are excluded from mutants generation.

Actual behaviour:

Because of the default behaviour of cargo-mutants (and due to the non-existency of this command line parameter) there are mutants generated for the files both in /src/tests and /src/config

Metadata

Metadata

Assignees

Labels

nextLikely to be worked on soon

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions