Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Breaking down FilePattern #2681

Merged
merged 7 commits into from
Oct 13, 2023

Conversation

psfinaki
Copy link
Contributor

Part of this PR.

Consider this file pattern: !MyFolder/MyService.cs{10..100}. It has three parts:

  • ! mark, indicating file exclusion
  • file path (MyFolder/MyService.cs)
  • mutant spans notation ({10..100})

The FilePattern currently handles this by immediately transforming the string into file path Glob and Roslyn-specific TextSpans.

The PR changes this by adding an intermediary phase of this transformation. It adds the ExcludableString class which has a notion of three parts of the string but doesn't convert the mutant spans part to the TextSpans yet.

This has two following advantages:

  • We are going to handle the mutant spans part differently for C# and F#
  • We don't need Roslyn-specific TextSpans for the DiffIgnoreChangesInput, there we only look at the exclusion and glob

Along the way, this simplifies a few tests and lightens up the FilePattern class.

@rouke-broersma rouke-broersma changed the title Breaking down FilePattern chore: Breaking down FilePattern Oct 13, 2023
@rouke-broersma rouke-broersma enabled auto-merge (squash) October 13, 2023 08:41
@rouke-broersma rouke-broersma merged commit b4f22e5 into stryker-mutator:master Oct 13, 2023
6 checks passed
rouke-broersma added a commit that referenced this pull request Oct 13, 2023
* chore(deps): update dependency buildalyzer to v5.0.1 (#2665)

* chore(deps): update dependency buildalyzer to v5.0.1

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore: fix page links for site

* fix: Don't fail the test run if restoring test assemblies fails (#2664)

* chore(deps): update xunit-dotnet monorepo to v2.5.1 (#2673)

* chore(deps): update xunit-dotnet monorepo to v2.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.4.0 (#2677)

* chore(deps): update dependency yamldotnet to v13.4.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore: F# range math (#2679)

* F# range math

* Windows x Linux

* Up

* chore: Passing Stryker options to F# project components (#2680)

Co-authored-by: Rouke Broersma <[email protected]>

* fix: Use solution file when it's available (#2690)

* Use solution file when it's available

* fix unit test

* sonarqube

* chore(compilation): Improve Error and Trace Logging (#2688)

Add logs

Co-authored-by: Rouke Broersma <[email protected]>

* fix: Remove usings from MutantControl (#2694)

chore: remove usings from MutantControl

Co-authored-by: Rouke Broersma <[email protected]>

* chore: Code quality improvements (#2696)

* Use string builder in loop

* Use find & handle other platform newlines

* Use find

* Fix duplicate message

* Add more range tests

* Improve range code

* docs: add SAS configuration (#2676) (#2701)

docs: add SAS configuration

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0 (#2702)

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.5.0 (#2703)

* chore(deps): update dependency yamldotnet to v13.5.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.5.1 (#2704)

* chore(deps): update dependency yamldotnet to v13.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.7.0 (#2705)

* chore(deps): update dependency yamldotnet to v13.7.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update xunit-dotnet monorepo (#2711)

* chore(deps): update xunit-dotnet monorepo

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore: Breaking down FilePattern (#2681)

* Simplifying DiffIgnoreChangesInput

* Update FilePattern.cs

* Up

* up

* Rename the class

* up

---------

Co-authored-by: Rouke Broersma <[email protected]>

* chore: Splitting some C# related extensions in a separate file (#2697)

Splitting some C# related extensions in a separate file

Co-authored-by: Rouke Broersma <[email protected]>

* fix: tests for `OpenReportEnabledInput` help text

* fix: typo in re(c)reate

* add: tests for baseline target input.

change: target input default to 'master' to stay consistent with since target input.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovatebot <[email protected]>
Co-authored-by: Rouke Broersma <[email protected]>
Co-authored-by: Pent Ploompuu <[email protected]>
Co-authored-by: Petr <[email protected]>
Co-authored-by: Rouke Broersma <[email protected]>
Co-authored-by: Jack Steel <[email protected]>
Co-authored-by: Cyrille DUPUYDAUBY <[email protected]>
Co-authored-by: Max S <[email protected]>
richardwerkman pushed a commit that referenced this pull request Oct 13, 2023
* chore(deps): update dependency buildalyzer to v5.0.1 (#2665)

* chore(deps): update dependency buildalyzer to v5.0.1

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore: fix page links for site

* fix: Don't fail the test run if restoring test assemblies fails (#2664)

* chore(deps): update xunit-dotnet monorepo to v2.5.1 (#2673)

* chore(deps): update xunit-dotnet monorepo to v2.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.4.0 (#2677)

* chore(deps): update dependency yamldotnet to v13.4.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore: F# range math (#2679)

* F# range math

* Windows x Linux

* Up

* chore: Passing Stryker options to F# project components (#2680)

Co-authored-by: Rouke Broersma <[email protected]>

* fix: Use solution file when it's available (#2690)

* Use solution file when it's available

* fix unit test

* sonarqube

* chore(compilation): Improve Error and Trace Logging (#2688)

Add logs

Co-authored-by: Rouke Broersma <[email protected]>

* fix: Remove usings from MutantControl (#2694)

chore: remove usings from MutantControl

Co-authored-by: Rouke Broersma <[email protected]>

* chore: Code quality improvements (#2696)

* Use string builder in loop

* Use find & handle other platform newlines

* Use find

* Fix duplicate message

* Add more range tests

* Improve range code

* docs: add SAS configuration (#2676) (#2701)

docs: add SAS configuration

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0 (#2702)

* chore(deps): update dependency launchdarkly.eventsource to v5.1.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.5.0 (#2703)

* chore(deps): update dependency yamldotnet to v13.5.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.5.1 (#2704)

* chore(deps): update dependency yamldotnet to v13.5.1

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update dependency yamldotnet to v13.7.0 (#2705)

* chore(deps): update dependency yamldotnet to v13.7.0

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore(deps): update xunit-dotnet monorepo (#2711)

* chore(deps): update xunit-dotnet monorepo

* Update package lock files

---------

Co-authored-by: Renovatebot <[email protected]>

* chore: Breaking down FilePattern (#2681)

* Simplifying DiffIgnoreChangesInput

* Update FilePattern.cs

* Up

* up

* Rename the class

* up

---------

Co-authored-by: Rouke Broersma <[email protected]>

* chore: Splitting some C# related extensions in a separate file (#2697)

Splitting some C# related extensions in a separate file

Co-authored-by: Rouke Broersma <[email protected]>

* fix: tests for `OpenReportEnabledInput` help text

* fix: typo in re(c)reate

* add: tests for baseline target input.

change: target input default to 'master' to stay consistent with since target input.

* fix: cli info text test

* also check if WithBaselineInput is true

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovatebot <[email protected]>
Co-authored-by: Rouke Broersma <[email protected]>
Co-authored-by: Pent Ploompuu <[email protected]>
Co-authored-by: Petr <[email protected]>
Co-authored-by: Rouke Broersma <[email protected]>
Co-authored-by: Jack Steel <[email protected]>
Co-authored-by: Cyrille DUPUYDAUBY <[email protected]>
Co-authored-by: Max S <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants