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

[doctor] check if native files in local Expo modules are being ignored #28484

Merged
merged 4 commits into from May 1, 2024

Conversation

keith-kurak
Copy link
Contributor

Why

An issue we've run into a few times is where someone creates a local module, but set their gitignore file to ignore their app's native project folders, but they made that match too greedy, so it ignores all android and ios folders.

The errors can be a little confusing when this happens... you'll get all the way to Fastlane and it'll be like, "I can't find this Cocoapod".

Matches like /ios or ios/** are fine, but ios is not.

How

Check for:
a) does the modules folder exist?
b) if so, do any files match modules/**/ios/*.podspec or modules/**/android/buld.gradle?
c) if so, are any of those files gitignored?

Optimally, I'd check .easignore, as well, but this should catch most cases. AFAIK, checking .easignore would require reading the file and using minimatch, so a completely different mechanism than the existing gitignore check, which is pretty thorough because it uses git check-ignore from the top level. A good long-term goal would be to refactor into a general-purpose ignore check that reports back what exactly is ignoring a file and can be used by multiple checks..

Test Plan

image

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 26, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 26, 2024
@keith-kurak keith-kurak force-pushed the keith/doctor-dont-gitignore-expo-modules branch from abab4db to 0adf3d1 Compare April 30, 2024 21:17
Copy link
Member

@byCedric byCedric left a comment

Choose a reason for hiding this comment

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

Awesome, nice to see the tests too!

@keith-kurak keith-kurak merged commit 13a6da5 into main May 1, 2024
11 checks passed
@keith-kurak keith-kurak deleted the keith/doctor-dont-gitignore-expo-modules branch May 1, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants