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

Option to Exclude path to avoid picking up localisation from Pods and imported libs #63

Closed
romanr opened this issue Jul 31, 2017 · 8 comments

Comments

@romanr
Copy link
Contributor

romanr commented Jul 31, 2017

Would be great to have --exclude path option, to avoid picking up localisation from Pods and imported libraries

For example project has this structure:

  • Module1
  • Module2
  • Module3
  • Pods

running bartycrouch code -p . will include localization from Pods or any third party libraries happen to be relative to project root. It mixes those 3rd party strings into your Localizable.strings.

Yes, the sources can be organized under something like /src in root of project, but that never happens. Sources are never in their own separate subtree.

As workaround paths can be included by running command multiple times. bartycrouch code -p Module1 , bartycrouch code -p Module2 etc. but that is not sustainable.

@Jeehut
Copy link
Member

Jeehut commented Aug 1, 2017

What about we simply add Pods/ to this array? That should solve your problem easily, shouldn't it? Wanna post a PR? Should be a quick one. ;)

@romanr
Copy link
Contributor Author

romanr commented Aug 1, 2017

Yes, of course Pods/ should be added there.

Still, there may be cases when you integrate some library by copying sources or using git submodule and it appears in project root among your regular sources.

@Jeehut
Copy link
Member

Jeehut commented Aug 1, 2017

Sure, there could be such cases. If you want, you can add options named exclude and include for such cases which are whitelists or blacklists of folders. But I think using a folder named Sources (or ProjectName which is Xcodes default) is an existing workaround which is also a good idea in general (e.g. the Swift Package Manager recommends this as well).

Unfortunately I don't have much free time right now to fix issues that are no real problems. You had a real problem with the Pods folder which many others might have, too. So I suggested a solution for that. For any other ideas I'm thankful for your issue but I won't have time to deal with it anytime soon. I'd happily merge it though if it was implemented, tested and documented in a PR though. ;)

@romanr
Copy link
Contributor Author

romanr commented Aug 1, 2017

No problem. Should I add Pods/ there or you will do it?

@Jeehut
Copy link
Member

Jeehut commented Aug 1, 2017

A PR would be nice! 🙂

romanr added a commit to Hitask/BartyCrouch that referenced this issue Aug 1, 2017
@Jeehut Jeehut closed this as completed in dd5d07e Aug 2, 2017
@mygzi
Copy link

mygzi commented May 22, 2018

The fix from dd5d07e doesn't address the OP's request to avoid pulling in 3rd party (cocoapod) strings. The array to which Pods/ was added filters the -l /directory/containing/all/Localizables path rather than the -p /path/to/code/directory path.

I've implemented a similar directory filter in CodeCommander.findFiles which does the trick in our project. Would you prefer to reopen this issue or start a new one?

@Jeehut
Copy link
Member

Jeehut commented May 23, 2018

Please open a new issue and feel free to post your change as a PR, independent from which issue it fixes. Would be great 👍

@sh95014
Copy link

sh95014 commented Feb 12, 2022

The discussion appears to continue at #156

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

No branches or pull requests

4 participants