renatoliveira / apex-test-list

List Apex tests for your CI/CD pipeline.
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Consider Allowing Multiple RegEx Matches Per File #68

Open mcarvin8 opened 4 hours ago

mcarvin8 commented 4 hours ago

In the event a single Apex class had lots of tests declared in annotation (like more than 10 or 20), it would make the comment harder to read in some views.

Probably not that common of an occurrence, but depending on your formatting preferences, some people might want each test annotation to be on its own line. Or if 2 developers added test annotations in 2 separate areas (which I've seen in my repo), only 1 of the annotations would get picked up.

I know a lot can come back to best practices, but if the tool could allow it, I think that would be useful.

Example, if 1 Apex Class had multiple comment lines like:

// @Tests   :    Sample2Test
// @Tests   :    SuperSample2Test
// @Tests   :    SuperSampleTest

Each test should be picked up.

Feel free to reject this if you disagree, but you might just want to update the README to tell people only the first match in the file will be used by the plugin.

renatoliveira commented 4 hours ago

While I do agree to some extent that this should be best practice/agreed by the development team, I also see your point in how the list can grow larger than the default line settings (I set my editor's rule to 80, so I know very well where you are coming from with this!).

However, wouldn't this be the case for creating a test suite in the project, and then using the @TestSuites annotation? Just an idea, which might not apply to your use case specifically, but would like to know what you think about it.

mcarvin8 commented 4 hours ago

Yea true that makes sense with the Test Suite then.

I'm fine with closing this as rejected then since that makes sense to me.

The update seems straight forward, but you can close for now and see if anyone else brings this up who's using your plugin.