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

Regexp directives #2

Open
nikolaydubina opened this issue Nov 25, 2022 · 5 comments
Open

Regexp directives #2

nikolaydubina opened this issue Nov 25, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@nikolaydubina
Copy link
Owner

suggested:

image

issues:

  • how to combine?
  • case 1: exclude all, but select some
  • case 2: include all, but select some
@justinfx
Copy link

When I offered the suggestion in the first place, my thinking was that the default mode of the tool was to automatically include all functions. That would be the equivalent of these default settings:

instrument:exclude
instrument:include .*

These two directives could be run first to establish the initial instrument function table. And then any user directives would act upon filtering this instrument table, vs all available functions.

The evaluation should always run the users exclude rules first, and then the include rules. This default case then builds an instrument table containing all functions.

This means the user could then exclude some:

//instrument:exclude Some 

Now if the user wants to invert the default mode and exclude all, but include some, they just need to define the exclude to clear the table and then add back in a subset:

//instrument:exclude .*
//instrument:include Some

As far as I can tell, this shouldn't collide between the logic of two modes you mentioned. The system should always start with an include-all approach, and then apply all user excludes first and then includes second.

@nikolaydubina
Copy link
Owner Author

nikolaydubina commented Nov 25, 2022 via email

@nikolaydubina
Copy link
Owner Author

nikolaydubina commented Nov 25, 2022 via email

@nikolaydubina
Copy link
Owner Author

nikolaydubina commented Nov 25, 2022 via email

@justinfx
Copy link

justinfx commented Nov 26, 2022

My opinion is that you shouldn't need to guarantee order across files. It should just collect them all into exclude and include maps and then run all the excludes and then all the includes. If users want to spread them all around then they should just be aware not to do very wide nets on their regex and just use them to include one off functions.

Edit: to be clear, I mean per package, like the way imports work.

@nikolaydubina nikolaydubina added the enhancement New feature or request label Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants