pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Automatically include `.gitignore` in `project_excludes`

Open connernilsen opened this issue 7 months ago • 4 comments

We want to be able to include .gitignore globs in project_excludes by default to reduce the amount of manual configuration that needs to be done.

Right now, we have some basic, hard-coded defaults to ignore certain files/patterns we notice aren't useful to search for type checking. We should expand this behavior to include everything we can find in a .gitignore.

This will likely involve three steps:

  1. Performing an upward search for a .gitignore file
  2. Parsing the results of the .gitignore file and turning them into two Globs, one for includes and another for excludes
  3. Wiring it into the config, most likely in Config::configure()

connernilsen avatar May 20 '25 19:05 connernilsen

i'm a new contributor, and want to work on this. Do i need to assign myself or just start?

BaoNguyen09 avatar May 28 '25 21:05 BaoNguyen09

@BaoNguyen09 I can assign you, go ahead and start, and let us know if you have any questions

Thanks!

yangdanny97 avatar May 29 '25 03:05 yangdanny97

Hey @BaoNguyen09, thanks for picking this up! Please let me know if you have any questions with this, and feel free to join our Discord server for quicker feedback (you can DM me directly if you need).

connernilsen avatar May 29 '25 15:05 connernilsen

For sure, i'm setting up the project and will ask you as soon as i need anything. Thank you for the support!

BaoNguyen09 avatar May 29 '25 18:05 BaoNguyen09

Hey @BaoNguyen09, just wanted to check in and see how it's going. Have you been able to take a look yet? Don't forget that we're here if you have any questions about getting it set up/implementation approaches/....

connernilsen avatar Jun 05 '25 21:06 connernilsen

yeah i'm working on it right now, last week was busy but i finished setting up and understanding the issue now

BaoNguyen09 avatar Jun 06 '25 00:06 BaoNguyen09

Awesome, thanks for the update @BaoNguyen09!

connernilsen avatar Jun 06 '25 15:06 connernilsen

I was working on a similar bug with globbing, and found this spot where it actually might be better to wire it in compared to Config::configure(), since it will be easier for us to access in our main.rs entrypoint.

Hope this helps!

connernilsen avatar Jun 06 '25 19:06 connernilsen

@BaoNguyen09 and I spoke async, and decided to put it back out for anyone to pick up if they're interested.

connernilsen avatar Jun 23 '25 16:06 connernilsen

Hey, I'm a newcomer and would totally love to help. Could you assign me on this?

johernandezvaz avatar Jun 25 '25 23:06 johernandezvaz

Hey @johernandezvaz, sure! Let us know if you need pointers.

connernilsen avatar Jun 26 '25 00:06 connernilsen

Hey @johernandezvaz, sure! Let us know if you need pointers.

Yeah, I actually do believe I've got to make a pull request for this, I already forked it, just looking into how it's best to work on this

johernandezvaz avatar Jun 26 '25 00:06 johernandezvaz

This issue has someone assigned, but has not had recent activity for more than 2 weeks.

If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

Thank you for your contributions!

github-actions[bot] avatar Jul 10 '25 00:07 github-actions[bot]

Putting this back up for grabs

yangdanny97 avatar Jul 15 '25 14:07 yangdanny97

I think I'm just going to take this so that I can get it done soon.

connernilsen avatar Jul 15 '25 20:07 connernilsen

This issue has someone assigned, but has not had recent activity for more than 2 weeks.

If you are still working on this issue, please add a comment so everyone knows. Otherwise, please unassign yourself and allow someone else to take over.

Thank you for your contributions!

github-actions[bot] avatar Aug 04 '25 00:08 github-actions[bot]

Completed with the diffs landed with #862

connernilsen avatar Aug 08 '25 16:08 connernilsen