-
Notifications
You must be signed in to change notification settings - Fork 382
Add danger rule to show a warning if new files are not added to Revenuecat.xcodeproj #5473
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
Conversation
21aadb7
to
2ebf058
Compare
4755fc7
to
d293927
Compare
@facumenzella This is great 😀 Do we want the PR check to fail if a file is missing since it might break installations? |
@rickvdl kind of. I wasn't sure about failing, mainly because I don't trust the script yet 😅 . If it works, I think we can make it more strict. For context: This #5472 broke the APITests. What do you think? |
@facumenzella Sounds good, I was also on the fence between that and making it fail right away, so let's do that 👍 |
@@ -0,0 +1,61 @@ | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this file was added for testing, should it be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love me some good automation!
end | ||
|
||
# Get all added Swift files in this PR that belong to relevant directories | ||
added_swift_files = git.added_files.select do |file| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does added_files
include renamed/moved files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this only includes added files.
My reasoning is that new files can break part of the project because the project does not know they exist, but removed files will break it instantly because the project expects those to be there.
Also, handling renamed / removed will make this more complex. IF we need it, I can add it but this should catch most of the bugs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, works for me! I was thinking we can grep for "added + renamed" files, but you're right that most bugs will be caused by (missing) added files. We can always revisit it later indeed.
Checklist
purchases-android
and hybridsMotivation
Description