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

Add option to use rules from .gitignore even if .pubignore present #4546

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JaffaKetchup
Copy link

@JaffaKetchup JaffaKetchup commented Mar 19, 2025

Fixes #4545.

When a .pubignore is present, it is read. If it starts with, on an independent line, the phrase:

#@ include .gitignore

(ignoring whitespace), then rules from gitignore are also considered.

I've not added tests, and the issue hasn't been discussed - maybe it's not such a good idea as it's adding some complexity to a simple format (and it doesn't exist in the gitignore 'spec'), or maybe it's not adding enough complexity (maybe the user should be required to state the path to a file). I'm not sure how else such a feature could be implemented, however.
But since it's an easy change to make, it's not a waste of time if not accepted. I can add tests if needed, but might need some guidance on how best to do it.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@JaffaKetchup JaffaKetchup marked this pull request as draft March 19, 2025 20:42
@JaffaKetchup JaffaKetchup marked this pull request as ready for review March 19, 2025 20:56
Copy link
Contributor

@sigurdm sigurdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this.

I like the idea - @jonasfj are you in on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optionally respect the .gitignore even when a .pubignore is present
2 participants