Skip to content

Conversation

facumenzella
Copy link
Contributor

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Description

@facumenzella facumenzella force-pushed the test/dangerfile-new-files branch from 21aadb7 to 2ebf058 Compare August 13, 2025 15:40
@facumenzella facumenzella force-pushed the test/dangerfile-new-files branch from 4755fc7 to d293927 Compare August 13, 2025 15:49
@facumenzella facumenzella changed the title Test if new swift file throws a warning Add danger rule to show a warning if new files are not added to Revenuecat.xcodeproj Aug 13, 2025
@facumenzella facumenzella marked this pull request as ready for review August 13, 2025 15:50
@facumenzella facumenzella requested a review from a team August 13, 2025 15:50
@rickvdl
Copy link
Contributor

rickvdl commented Aug 13, 2025

@facumenzella This is great 😀 Do we want the PR check to fail if a file is missing since it might break installations?

@facumenzella
Copy link
Contributor Author

@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.
Until we fully migrate to tuist, we will need to support both so this felt like an easy check.

What do you think?

@rickvdl
Copy link
Contributor

rickvdl commented Aug 13, 2025

@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 @@
//
Copy link
Contributor

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?

Copy link
Member

@JayShortway JayShortway left a 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|
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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.

@facumenzella facumenzella merged commit f19c2d6 into main Aug 14, 2025
12 checks passed
@facumenzella facumenzella deleted the test/dangerfile-new-files branch August 14, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants