muter-mutation-testing / muter

🔎 Automated mutation testing for Swift 🕳️
MIT License
496 stars 39 forks source link

Enhance file exclusion by ignoring Package.swift and make it more folder aware #258

Closed Nikoloutsos closed 8 months ago

Nikoloutsos commented 9 months ago

Hello, this PR implements what is proposed here https://github.com/muter-mutation-testing/muter/issues/250 and https://github.com/muter-mutation-testing/muter/issues/259

Nikoloutsos commented 9 months ago

Will check later why the acceptance test fails on test_xcodeFormat. Locally it passes 🤔

Update: It looks like this test is flaky. It is not introduced in this PR. I will probably investigate it more in a separate PR.

rakaramos commented 9 months ago

hey @Nikoloutsos thanks for the PR, I'm reviewing this soon.

rakaramos commented 9 months ago

@Nikoloutsos will it work if the client project has a file named Package.swift that is not the SPM manifest?

Nikoloutsos commented 9 months ago

@rakaramos Happy new year 🥳 At this point the filtering only checks if the file path contains a specific substring.

MyProject/Package.swift --> Will be ignored by default 🟢 MyProject/UtilPackage.swift --> Will NOT be ignored since /Package.swift is not a substring

So yes if somebody is using Package.swift as the name of a file it will be ignored. But IIRC this filename is preserved so it is not a best practice to use it.

Nikoloutsos commented 9 months ago

@rakaramos I've dropped the ExampleSPM folder. Let me know if there is anything more you would like to discuss.

rakaramos commented 8 months ago

@Nikoloutsos its fine for now, we can revisit this later and do some extra checks to make sure that we are not ignoring something that we should not. thanks!