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

Revisit includes and excludes logic #22

Closed
Tracked by #16
tisonkun opened this issue Jan 5, 2023 · 4 comments
Closed
Tracked by #16

Revisit includes and excludes logic #22

tisonkun opened this issue Jan 5, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tisonkun
Copy link
Member

tisonkun commented Jan 5, 2023

Currently, we build includes and excludes in Selection using buildOverrideInclusions, buildExclusions and buildInclusions.

I don't think it's a clean way and I don't agree that we should explicitly specify exact includes to remove default exclusions.

Basically, we should evaluate includes and excludes with priority and acting like a painter:

  1. Filter if in default includes if no user-defned includes.
  2. If in default excludes, pending to be ignored.
  3. If in user-defined includes, bring it back.
  4. If in user-defined excludes, kick it off again.

In this way, we can append and plugin includes and excludes like the idea in #20 to respect .gitignore configs.

@tisonkun tisonkun mentioned this issue Jan 5, 2023
20 tasks
@tisonkun tisonkun added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 5, 2023
@tisonkun
Copy link
Member Author

tisonkun commented Jan 6, 2023

Here I meet a case in that we have default excludes **/.svn and user include *.txt, it's hard to determine whether we should skip the folder.

If we evaluate always on files, not only the time consumption will increase, but also ignore a dir should be always folder/**.

@tisonkun
Copy link
Member Author

tisonkun commented Jan 6, 2023

@tisonkun
Copy link
Member Author

tisonkun commented Jan 6, 2023

Fix build inclusion at d8e8ca4.

Maybe we can close this issue as is now.

@tisonkun
Copy link
Member Author

tisonkun commented Jan 7, 2023

Follow-up by 8cda4b2 to avoid using inclusion for inverting exclusion, but introduce an explicit invert exclusion syntax !<invert-exclude-rule>.

Closing...

Maybe we can learn more from other libraries like gitignore to see how to make better configuration on these things.

@tisonkun tisonkun closed this as completed Jan 7, 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 good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant