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

Remove annoying warning "No files found at:" for glob path #5552

Open
Ernest0-Production opened this issue Nov 7, 2023 · 9 comments · May be fixed by #6069
Open

Remove annoying warning "No files found at:" for glob path #5552

Ernest0-Production opened this issue Nov 7, 2023 · 9 comments · May be fixed by #6069
Assignees
Labels
good first issue Good for newcomers type:need/problem Report needs or problems you came across that are not bugs

Comments

@Ernest0-Production
Copy link

Ernest0-Production commented Nov 7, 2023

What problem or need do you have?

⚠️ It is very annoying and seems redundant to see a long list of logs for each target in which not a single file matching the pattern {storyboard,xib} etc. is found:

No files found at: /Users/ernest0n/Projects/MY_PROJECT/FeatureModules/RepositoryKit/Sources/**/*.{xcassets,strings,ttf,js,xib,storyboard}
No files found at: /Users/ernest0n/Projects/MY_PROJECT/FeatureModules/RepositoryKit/*.playground
No files found at: /Users/ernest0n/Projects/MY_PROJECT/FeatureModules/Logger/Sources/**/*.{xcassets,strings,ttf,js,xib,storyboard}
No files found at: /Users/ernest0n/Projects/MY_PROJECT/FeatureModules/NetworkServices/*.playground
No files found at: /Users/ernest0n/Projects/MY_PROJECT/FeatureModules/UIKitHelpers/*.playground
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/NotificationServiceExtension/Sources/**/*.{xib,storyboard}
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/NotificationServiceExtension/Resources/**/*
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/NotificationServiceExtension/Sources/**/*.h
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/NotificationContentExtension/Resources/**/*
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/NotificationContentExtension/Sources/**/*.h
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/WidgetExtension/Sources/**/*.{xib,storyboard}
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/UnitTests/Sources/**/*.{xib,storyboard}
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/OSUnitTests/Sources/**/*.h
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/UITests/Sources/**/*.{xib,storyboard}
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/UITests/Resources/**/*
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/UITests/Sources/**/*.h
No files found at: /Users/ernest0n/Projects/MY_PROJECT/Application/WatchOSApp/Sources/**/*.{xib,storyboard}

I have a single template (Target extension) in which I have specified a glob path for all sources and/or resources and other target/project parameters to which I need to transfer a list of files.

II see no reason to show the user (the developers of my team) a warning that there are no files in the specified directory, because their presence is optional.

In my opinion, it makes sense to display an error like this when a concrete (non glob) path is specified.
I looked at the sources and did not find a single parameter that could be passed externally to suppress these warnings

Potential solution

No response

macOS version

13.6.1

Tuist version

3

Xcode version

14.3.1

@Ernest0-Production Ernest0-Production added the type:need/problem Report needs or problems you came across that are not bugs label Nov 7, 2023
@Ernest0-Production
Copy link
Author

@pepicrft Are there plans to fix this? It seems to me that this revision would be useful in large cross-functional teams in which modules are created according to a certain template with optional options

@pepicrft pepicrft added the good first issue Good for newcomers label Feb 21, 2024
@pepicrft
Copy link
Contributor

pepicrft commented Feb 21, 2024

I added it to our bounty program and flagged it as a good-first-time issue to see if anyone wants to pick it up. Unfortunately, it'll take us some time to get to it because there are some other issues in the list that are preventing users from using some Tuist features, and those usually take priority. I can give you pointers if you are interested in tackling it yourself.

@VorkhlikArtem
Copy link

Hello, @Ernest0-Production,
Instead of adding resource extensions just on the contrary exclude sources and headers extensions (and some other supporting file extensions) in excluding array. For example, here I exclude .swift, .m, headers and explicitly Info.plist :

resources: [
    .glob(pattern: "MyTarget/**", excluding: "**/{*.{swift,m,h},Info.plist}"),
]

Please, read my full idea around this here: #6032

@Ernest0-Production
Copy link
Author

Ernest0-Production commented Mar 5, 2024

Hi! Thanks for the advice, but it seems to me that going from the opposite is not a completely correct decision.
It is more logical to specify a list of only those types of resources that need to be bundled, and not those that cannot.

The problem described in your proposal is related to a situation where resources are mixed with code, but even if they are separated, in my opinion, it still makes sense to explicitly set restrictions in the form of file extensions allowed for sources and for resources.

  • Folders pattern as paths regulate the structure of the project
  • but file extensions pattern also allow you to regulate what the system (xcode) should expect from it

@mustiikhalil
Copy link
Collaborator

Hey, I would love to tackle this issue, can It get assigned to me?

@Ernest0-Production is there a demo project to test things on from the fixtures that can be used?
@pepicrft if possible can I get those pointers so I can start working on it during the week?

@danieleformichelli
Copy link
Collaborator

@pepicrft should this be opt-out?
e.g. I understand the warning is a problem if the target is generated from a template (and hence you might want to ignore it there), but I think it's useful if the target is defined "manually"

@mustiikhalil
Copy link
Collaborator

if its opt-out would something like tuist generate --suppress-warnings work? and basically add that to the logger?

@Ernest0-Production
Copy link
Author

I think two things should be done here.

  1. Quiet mode, which removes any output except for an error.
  2. Do not consider the absence of files in the specified directory using the glob template to be incorrect behavior

@mustiikhalil
Copy link
Collaborator

mustiikhalil commented Mar 12, 2024

  1. Regarding the quiet mode, I think that can be done by wrapping the logger with a TuistLogger object that will have a flag that will be set to skip warnings.
  2. Im not sure about the second one since either ways the generate is the one that is supposed to be the one that suppresses the warning and not the tuist init correct me If I am wrong here. But ofc all the commands can have the --suppress-warning flag.

It would be nice to verify the thought process by the maintainers here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:need/problem Report needs or problems you came across that are not bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants